NAME

Test::Class::Moose::TagRegistry - Global registry of tags by class and method.

VERSION

version 0.12

SYNOPSIS

 use Test::Class::Moose::TagRegistry;

 my @tags = Test::Class::Moose::TagRegistry->tags;
 foreach my $tag ( @tags ) {
     my @classes = Test::Class::Moose::TagRegistry->classes_with_tag( $tag );

     foreach my $class ( @classes ) {
         my @methods = Test::Class::Moose::TagRegistry->methods_with_tag( $class, $tag );

         foreach my $method ( @methods ) {
             print Test::Class::Moose::TagRegistry->method_has_tag( $class, $method, $tag );
         }
     }
 }

DESCRIPTION

This class permits addition and querying of the tags defined on methods. It's been gleefully stolen from Attribute::Method::Tags and is for internal use only. Don't rely on this code.

METHODS

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.

add( $class, $method, $tags_ref )

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.

tags

Find all tags defined for all methods. Returns a sorted list of tags.

classes_with_tag( $tag )

Find all classes that have the specified tag. Returns a sorted list of classes.

methods_with_tag( $class, $tag )

Returns a sorted list of methods in the specified class that have the specified tag.

method_has_tag( $class, $method, $tag )

Returns a boolean (0|1), indicating whether the given method in the given class has the specified tag.

SEE ALSO

Attribute::Method::Tags

Attribute-based interface for adding tags to methods. Your author "liberated" this code from Attribute::Method::Tags::Registry (with a tip 'o the keyboard to Mark Morgan for his work on this).

AUTHOR

Curtis "Ovid" Poe <ovid@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Curtis "Ovid" Poe.

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