| 1 | package MooseX::MethodAttributes::Role::Meta::Method; | ||
| 2 | # ABSTRACT: metamethod role allowing code attribute introspection | ||
| 3 | |||
| 4 | 20 | our $VERSION = '0.32'; | |
| 5 | |||
| 6 | 20 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 20 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | #pod =attr attributes | ||
| 11 | #pod | ||
| 12 | #pod Gets the list of code attributes of the method represented by this meta method. | ||
| 13 | #pod | ||
| 14 | #pod =cut | ||
| 15 | |||
| 16 | 20 | has attributes => ( | |
| 17 | is => 'ro', | ||
| 18 | lazy => 1, | ||
| 19 | builder => '_build_attributes', | ||
| 20 | ); | ||
| 21 | |||
| 22 | #pod =method _build_attributes | ||
| 23 | #pod | ||
| 24 | #pod Builds the value of the C<attributes> attribute based on the attributes | ||
| 25 | #pod captured in the associated meta class. | ||
| 26 | #pod | ||
| 27 | #pod =cut | ||
| 28 | |||
| 29 | 27 | ▶ | sub _build_attributes { |
|
Subroutine
_build_attributes: called CC=1 SCAR=0.0
| |||
| 30 | 27 | my ($self) = @_; | |
| 31 | 27 | return $self->associated_metaclass->get_method_attributes($self->_get_attributed_coderef); | |
| 32 | } | ||
| 33 | |||
| 34 | 84 | ▶ | sub _get_attributed_coderef { |
|
Subroutine
_get_attributed_coderef: called CC=1 SCAR=0.0
| |||
| 35 | 84 | my ($self) = @_; | |
| 36 | 84 | return $self->body; | |
| 37 | } | ||
| 38 | |||
| 39 | 20 | 1; | |
| 40 | |||
| 41 | __END__ | ||