X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FFunctor%2FRule.pm;h=15cc4899600a2b58491fe7db5cbe8f07250fff4d;hp=efaff7b1cc73078b012ff9b7499ec87feacad17f;hb=2f8d25c7ced8c8bc43802025240ab7d673892f5d;hpb=ccef95119764f56b5f77bd85c5199f5d375ca08e diff --git a/lib/LaTeX/TikZ/Functor/Rule.pm b/lib/LaTeX/TikZ/Functor/Rule.pm index efaff7b..15cc489 100644 --- a/lib/LaTeX/TikZ/Functor/Rule.pm +++ b/lib/LaTeX/TikZ/Functor/Rule.pm @@ -17,7 +17,7 @@ our $VERSION = '0.01'; =head1 DESCRIPTION -A rule specifies how functors should handle a certain kind of set or mod. +A rule specifies how functors (L objects) should handle a certain kind of set or mod. A functor is basically an ordered collection of rules. =cut @@ -32,6 +32,9 @@ use Any::Moose 'Util::TypeConstraints'; =head2 C +A class or role name against which set or mod candidates will be matched. +It must consume either L or L, directly or through inheritance. + =cut has 'target' => ( @@ -42,6 +45,9 @@ has 'target' => ( =head2 C +The code reference executed when the rule handles a given set or mod object. +It is called with the L object as its first argument, the set/mod object as its second, and then the arguments passed to the functor itself. + =cut has 'handler' => ( @@ -52,6 +58,8 @@ has 'handler' => ( =head2 C +True if and only if the target is a role. + =cut has 'is_role' => ( @@ -62,6 +70,8 @@ has 'is_role' => ( =head2 C +True when the target does the L role, and false when it does L. + =cut has 'is_set' => ( @@ -77,6 +87,8 @@ my $ltfrl_tc = subtype 'LaTeX::TikZ::Functor::RuleList' =head2 C<< new target => $target, handler => $handler >> +Constructs a new rule object with target C<$target> and handler C<$handler>. + =cut around 'BUILDARGS' => sub {