line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::MethodAttributes::Role::Meta::Map; |
2
|
|
|
|
|
|
|
# ABSTRACT: generic role for storing code attributes used by classes and roles with attributes |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.30'; |
5
|
|
|
|
|
|
|
|
6
|
21
|
|
|
21
|
|
15907
|
use Moose::Role; |
|
21
|
|
|
|
|
59
|
|
|
21
|
|
|
|
|
179
|
|
7
|
21
|
|
|
21
|
|
121754
|
use MooseX::Types::Moose 0.21 qw/HashRef ArrayRef Str Int/; |
|
21
|
|
|
|
|
1118959
|
|
|
21
|
|
|
|
|
241
|
|
8
|
|
|
|
|
|
|
|
9
|
21
|
|
|
21
|
|
114544
|
use namespace::autoclean; |
|
21
|
|
|
|
|
53
|
|
|
21
|
|
|
|
|
113
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has _method_attribute_map => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
isa => HashRef[ArrayRef[Str]], |
14
|
|
|
|
|
|
|
lazy => 1, |
15
|
|
|
|
|
|
|
default => sub { +{} }, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has _method_attribute_list => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => ArrayRef[Int], |
21
|
|
|
|
|
|
|
lazy => 1, |
22
|
|
|
|
|
|
|
default => sub { [] }, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#pod =method register_method_attributes ($code, $attrs) |
26
|
|
|
|
|
|
|
#pod |
27
|
|
|
|
|
|
|
#pod Register a list of attributes for a code reference. |
28
|
|
|
|
|
|
|
#pod |
29
|
|
|
|
|
|
|
#pod =cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub register_method_attributes { |
32
|
67
|
|
|
67
|
1
|
720
|
my ($self, $code, $attrs) = @_; |
33
|
67
|
|
|
|
|
141
|
push @{ $self->_method_attribute_list }, 0 + $code; |
|
67
|
|
|
|
|
3266
|
|
34
|
67
|
|
|
|
|
2997
|
$self->_method_attribute_map->{ 0 + $code } = $attrs; |
35
|
67
|
|
|
|
|
373
|
return; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#pod =method get_method_attributes ($code) |
39
|
|
|
|
|
|
|
#pod |
40
|
|
|
|
|
|
|
#pod Get a list of attributes associated with a coderef. |
41
|
|
|
|
|
|
|
#pod |
42
|
|
|
|
|
|
|
#pod =cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub get_method_attributes { |
45
|
35
|
|
|
35
|
1
|
11450
|
my ($self, $code) = @_; |
46
|
35
|
|
100
|
|
|
1634
|
return $self->_method_attribute_map->{ 0 + $code } || []; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=encoding UTF-8 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
MooseX::MethodAttributes::Role::Meta::Map - generic role for storing code attributes used by classes and roles with attributes |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
version 0.30 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 register_method_attributes ($code, $attrs) |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Register a list of attributes for a code reference. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 get_method_attributes ($code) |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Get a list of attributes associated with a coderef. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHORS |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=over 4 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Tomas Doran <bobtfish@bobtfish.net> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This software is copyright (c) 2009 by Florian Ragwitz. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
94
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |