Vincent Pit > LaTeX-TikZ-0.02 > LaTeX::TikZ::Functor::Rule

Download:
LaTeX-TikZ-0.02.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

LaTeX::TikZ::Functor::Rule - An object that specifies how functors should handle a certain kind of set or mod.

VERSION ^

Version 0.02

DESCRIPTION ^

A rule specifies how functors (LaTeX::TikZ::Functor objects) should handle a certain kind of set or mod. A functor is basically an ordered collection of rules.

ATTRIBUTES ^

target

A class or role name against which set or mod candidates will be matched. It must consume either LaTeX::TikZ::Set or LaTeX::TikZ::Mod, directly or through inheritance.

handler

The code reference executed when the rule handles a given set or mod object. It is called with the LaTeX::TikZ::Functor object as its first argument, the set/mod object as its second, and then the arguments passed to the functor itself.

is_role

True if and only if the target is a role.

is_set

True when the target does the LaTeX::TikZ::Set role, and false when it does LaTeX::TikZ::Mod.

METHODS ^

new target => $target, handler => $handler

Constructs a new rule object with target $target and handler $handler.

insert into => \@list, overwrite => $overwrite, replace => $replace

Inserts the current rule into the list of rules @list.

If $replace is false, then the rule will be appended to the @list ; except if there already is an existent entry for the same target, in which case it will be overwritten if $overwrite is true, or an exception will be thrown if it is false.

If $replace is true, then the rule will replace the first rule in the list that is a subclass or that consumes the role denoted by the target. All the subsequent rules in the list that inherit or consume the target will be removed.

handles $obj

Returns true if and only if the current rule can handle the object or class/role name $obj.

SEE ALSO ^

LaTeX::TikZ, LaTeX::TikZ::Functor.

AUTHOR ^

Vincent Pit, <perl at profvince.com>, http://www.profvince.com.

You can contact me by mail or on irc.perl.org (vincent).

BUGS ^

Please report any bugs or feature requests to bug-latex-tikz at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LaTeX-TikZ. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc LaTeX::TikZ

COPYRIGHT & LICENSE ^

Copyright 2010 Vincent Pit, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: