Attribute::Method::Tags::Registry - Global registry of tags by class and method.
# tags previously created via Attribute::Method::Tags use Attribute::Method::Tags::Registry; my @tags = Attribute::Method::Tags::Registry->tags; foreach my $tag ( @tags ) { my @classes = Attribute::Method::Tags::Registry->classes_with_tag( $tag ); foreach my $class ( @classes ) { my @methods = Attributes::Method::Tags::Registry->methods_with_tag( $class, $tag ); foreach my $method ( @methods ) { print Attribute::Method::Tags::Registry->method_has_tag( $class, $method, $tag ); } } }
This class permits addition and querying of the tags defined on methods. It's normally meant to be used in conjunction with Attribute::Method::Tags.
All the following are class methods, as the tag registry is shared globally. Note that all parameters for any of the methods below are required.
Adds the given list of tags (as an array-ref) for the specified class/method combination. An exception will be raised if either the tags are non-alphanumeric or the method is one that has already had tags registered for it.
Find all tags defined for all methods. Returns a sorted list of tags.
Find all classes that have the specified tag. Returns a sorted list of classes.
Returns a sorted list of methods in the specified class that have the specified tag.
Returns a boolean (0|1), indicating whether the given method in the given class has the specified tag.
Attribute-based interface for adding tags to methods.
Mark Morgan <makk384@gmail.com>
Please send bugs or feature requests through to bugs-Attribute-Method-Tags@rt.rt.cpan.org or through web interface http://rt.cpan.org .
Copyright 2010 Mark Morgan, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Attribute::Method::Tags, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attribute::Method::Tags
CPAN shell
perl -MCPAN -e shell install Attribute::Method::Tags
For more information on module installation, please visit the detailed CPAN module installation guide.