]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Functor.pm
Small doc clarification in LT::Functor
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Functor.pm
index 7e64142f1402b9d5a3b7cc13df143fe8f313deb5..eaf13cabed4a9b35bc7eb778cbc7977e8624ce47 100644 (file)
@@ -18,6 +18,7 @@ our $VERSION = '0.01';
 =head1 DESCRIPTION
 
 A functor takes a L<LaTeX::TikZ::Set> tree and clones it according to certain rules.
+Rules can apply not only to L<LaTeX::TikZ::Set> objects, but also to the L<LaTeX::TikZ::Mod> objects they contain.
 
 =cut
 
@@ -122,29 +123,6 @@ BEGIN {
 
 =head1 METHODS
 
-=head2 C<< default_rule $spec => $handler >>
-
-Adds to all subsequently created functors a default rule for the class or role C<$spec>.
-
-An exception is thrown if there is already a default rule for C<$spec> ; otherwise, the new rule is appended to the current list of rules.
-But if C<$spec> begins with C<'+'>, the rule will replace I<all> default rules that apply to subclasses or subroles of C<$spec> (including C<$spec> itself).
-
-Returns true if and only if an existent rule was replaced.
-
-=cut
-
-sub default_rule {
- shift;
-
- my $rule = $validate_rule->(@_);
-
- $insert_rule->(
-  $rule,
-  $rule->[4] ? \@default_set_rules : \@default_mod_rules,
-  0,
- );
-}
-
 =head2 C<< new rules => [ $spec1 => $handler1, $spec2 => $handler2, ... ] >>
 
 Creates a new functor object that will use both the default and these user-specified rules.
@@ -260,6 +238,29 @@ LaTeX::TikZ::Interface->register(
  },
 );
 
+=head2 C<< default_rule $spec => $handler >>
+
+Adds to all subsequently created functors a default rule for the class or role C<$spec>.
+
+An exception is thrown if there is already a default rule for C<$spec> ; otherwise, the new rule is appended to the current list of rules.
+But if C<$spec> begins with C<'+'>, the rule will replace I<all> default rules that apply to subclasses or subroles of C<$spec> (including C<$spec> itself).
+
+Returns true if and only if an existent rule was replaced.
+
+=cut
+
+sub default_rule {
+ shift;
+
+ my $rule = $validate_rule->(@_);
+
+ $insert_rule->(
+  $rule,
+  $rule->[4] ? \@default_set_rules : \@default_mod_rules,
+  0,
+ );
+}
+
 =head1 SEE ALSO
 
 L<LaTeX::TikZ>.