CHI::Cascade::Rule - a rule class
$cascade->rule( target => qr/^target_(\d+)$/, depends => 'base_target', code => sub { my ( $rule, $target, $dep_values ) = @_; # For executino of $cascade->run('target_12') will be: # # $rule->target eq $target # $rule->depends === [ 'base_target' ] # $rule->qr_params === ( 12 ) # $rule->params == [ 1, 2, 3 ] }, params => [ 1, 2, 3 ] ); $cascade->run('target_12');
An instance of this object is created by CHI::Cascade in "rule" in CHI::Cascade.
The instance of this object is passed to "code" in CHI::Cascade, "coderef" in CHI::Cascade, "recomputed" in CHI::Cascade, "depends_catch" in CHI::Cascade by CHI::Cascade as first argument (The API of running this code was changed since v0.16). You can use it object as accessor to some parameters of your currect executed target.
returns a list. Is used for getting a result of =~ operation if target is described for rule through qr// operator.
=~
qr//
returns arrayref of dependencies (depends option of rule method) even if one scalar value is passed there (as one dependence). Always is defined even there no defined depends option for rule. If 'depends' is coderef you will get a returned value of one.
depends
rule
returns current target as plain text after matching.
returns any data of any type what were passed to "params" in CHI::Cascade
returns reference to CHI::Cascade instance object for this rule.
This module has been written by Perlover <perlover@perlover.com>
This module is free software and is published under the same terms as Perl itself.
CHI::Cascade
To install CHI::Cascade, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CHI::Cascade
CPAN shell
perl -MCPAN -e shell install CHI::Cascade
For more information on module installation, please visit the detailed CPAN module installation guide.