line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Emulate::Class::Accessor::Fast::Meta::Accessor; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
11
|
|
113
|
use Moose; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
59
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Moose::Meta::Method::Accessor'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub _generate_accessor_method { |
8
|
10
|
|
|
10
|
|
8240
|
my $attr = (shift)->associated_attribute; |
9
|
|
|
|
|
|
|
return sub { |
10
|
11
|
|
|
11
|
|
896
|
my $self = shift; |
|
|
|
|
0
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1
|
|
|
|
11
|
11
|
100
|
|
|
|
66
|
$attr->set_value($self, $_[0]) if scalar(@_) == 1; |
12
|
11
|
100
|
|
|
|
1089
|
$attr->set_value($self, [@_]) if scalar(@_) > 1; |
13
|
11
|
|
|
|
|
474
|
$attr->get_value($self); |
14
|
10
|
|
|
|
|
214
|
}; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _generate_writer_method { |
18
|
6
|
|
|
6
|
|
2550
|
my $attr = (shift)->associated_attribute; |
19
|
|
|
|
|
|
|
return sub { |
20
|
1
|
|
|
1
|
|
109
|
my $self = shift; |
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
4
|
|
|
|
21
|
1
|
50
|
|
|
|
6
|
$attr->set_value($self, $_[0]) if scalar(@_) == 1; |
22
|
1
|
50
|
|
|
|
190
|
$attr->set_value($self, [@_]) if scalar(@_) > 1; |
23
|
6
|
|
|
|
|
61
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# FIXME - this is shite, but it does work... |
27
|
|
|
|
|
|
|
sub _generate_accessor_method_inline { |
28
|
0
|
|
|
0
|
|
|
my $attr = (shift)->associated_attribute; |
29
|
0
|
|
|
|
|
|
my $attr_name = $attr->name; |
30
|
0
|
|
|
|
|
|
my $meta_instance = $attr->associated_class->instance_metaclass; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $code = eval "sub { |
33
|
|
|
|
|
|
|
my \$self = shift; |
34
|
|
|
|
|
|
|
\$self->{'$attr_name'} = \$_[0] if scalar(\@_) == 1; |
35
|
|
|
|
|
|
|
\$self->{'$attr_name'} = [\@_] if scalar(\@_) > 1; |
36
|
|
|
|
|
|
|
\$self->{'$attr_name'}; |
37
|
|
|
|
|
|
|
}"; |
38
|
0
|
0
|
|
|
|
|
confess "Could not generate inline accessor because : $@" if $@; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $code; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
my $meta = __PACKAGE__->meta; |
45
|
|
|
|
|
|
|
$meta->add_method(_generate_writer_method_inline => $meta->get_method('_generate_accessor_method_inline')); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
9
|
|
|
9
|
|
56226
|
no Moose; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
49
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |