Fukurama::Class::Attribute::OOStandard - Plugin for code attributes
Version 0.02 (beta)
package MyClass; use Fukurama::Class::Attributes; sub my_sub : Method(static|boolean|string,hashref) { my $class = $_[0]; my $string = $_[1]; my $hashref = $_[2]; return 1; }
This plugin for Fukurama::Class::Attributes provides code attributes to declare and check method an constructor definitions at compiletime and parameter and return value checks at runtime.
You can define the check-level which describes how the module will check your declarations for methods and constructors. The following levels are allowed:
There is no check. This level is recommended for production.
All registration processes are executed and the definitions of the code attributes would be checked at compiletime. This level is only for the sake of completeness.
If you define a code attribute at the parent class, you have to define the same or extended in child class. You can only extend optional parameters and thighten the method access level. All other woud fail at compiletime.
The default behavior. You have to define code attributes for all methods in your class, except perl internals.
The runtime check for parameter and return values can be disabled by saying:
$Fukurama::Class::Attributes::OOStandard::DISABLE_RUNTIME_CHECK = 1;
This is recommended for production.
-
Code attribute, which defines a constructor subroutine.
Code Attribute, which defines a method.
Helper method to compare every method declarations for code attributes in your class whith all in the parent methods.
see perldoc of Fukurama::Class
To install Fukurama::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fukurama::Class
CPAN shell
perl -MCPAN -e shell install Fukurama::Class
For more information on module installation, please visit the detailed CPAN module installation guide.