MooseX::MethodAttributes::Role::AttrContainer - capture code attributes in the class' metaclass


MooseX-MethodAttributes documentation Contained in the MooseX-MethodAttributes distribution.

Index


Code Index:

NAME

Top

MooseX::MethodAttributes::Role::AttrContainer - capture code attributes in the class' metaclass

METHODS

Top

MODIFY_CODE_ATTRIBUTES ($code, @attrs)

Accepts a list of attributes for a coderef and stores it the class' metaclass.

See attributes.

AUTHORS

Top

COPYRIGHT AND LICENSE

Top


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__