File Coverage

blib/lib/MooseX/MethodAttributes/Role/Meta/Method.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1             package MooseX::MethodAttributes::Role::Meta::Method;
2             # ABSTRACT: metamethod role allowing code attribute introspection
3              
4             our $VERSION = '0.32';
5              
6 20     20   105193 use Moose::Role;
  20         62  
  20         181  
7              
8 20     20   108988 use namespace::autoclean;
  20         58  
  20         216  
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             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             sub _build_attributes {
30 27     27   72 my ($self) = @_;
31 27         121 return $self->associated_metaclass->get_method_attributes($self->_get_attributed_coderef);
32             }
33              
34             sub _get_attributed_coderef {
35 84     84   469 my ($self) = @_;
36 84         343 return $self->body;
37             }
38              
39             1;
40              
41             __END__
42              
43             =pod
44              
45             =encoding UTF-8
46              
47             =head1 NAME
48              
49             MooseX::MethodAttributes::Role::Meta::Method - metamethod role allowing code attribute introspection
50              
51             =head1 VERSION
52              
53             version 0.32
54              
55             =head1 ATTRIBUTES
56              
57             =head2 attributes
58              
59             Gets the list of code attributes of the method represented by this meta method.
60              
61             =head1 METHODS
62              
63             =head2 _build_attributes
64              
65             Builds the value of the C<attributes> attribute based on the attributes
66             captured in the associated meta class.
67              
68             =head1 SUPPORT
69              
70             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-MethodAttributes>
71             (or L<bug-MooseX-MethodAttributes@rt.cpan.org|mailto:bug-MooseX-MethodAttributes@rt.cpan.org>).
72              
73             There is also a mailing list available for users of this distribution, at
74             L<http://lists.perl.org/list/moose.html>.
75              
76             There is also an irc channel available for users of this distribution, at
77             L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>.
78              
79             =head1 AUTHORS
80              
81             =over 4
82              
83             =item *
84              
85             Florian Ragwitz <rafl@debian.org>
86              
87             =item *
88              
89             Tomas Doran <bobtfish@bobtfish.net>
90              
91             =back
92              
93             =head1 COPYRIGHT AND LICENCE
94              
95             This software is copyright (c) 2009 by Florian Ragwitz.
96              
97             This is free software; you can redistribute it and/or modify it under
98             the same terms as the Perl 5 programming language system itself.
99              
100             =cut