| MooseX-MethodAttributes documentation | Contained in the MooseX-MethodAttributes distribution. |
MooseX::MethodAttributes::Role::AttrContainer - capture code attributes in the class' metaclass
Accepts a list of attributes for a coderef and stores it the class' metaclass.
See attributes.
This software is copyright (c) 2011 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| MooseX-MethodAttributes documentation | Contained in the MooseX-MethodAttributes distribution. |
package MooseX::MethodAttributes::Role::AttrContainer; BEGIN { $MooseX::MethodAttributes::Role::AttrContainer::AUTHORITY = 'cpan:FLORA'; } BEGIN { $MooseX::MethodAttributes::Role::AttrContainer::VERSION = '0.25'; } # ABSTRACT: capture code attributes in the class' metaclass use Moose::Role; use Moose::Util qw/find_meta/; use namespace::clean -except => 'meta'; sub MODIFY_CODE_ATTRIBUTES { my ($class, $code, @attrs) = @_; find_meta($class)->register_method_attributes($code, \@attrs); return (); } 1; __END__