line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
306
|
use 5.008003; |
|
1
|
|
|
|
|
3
|
|
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
4
|
no warnings qw( void once uninitialized ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.014'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Sub::HandlesVia::Toolkit; |
11
|
1
|
|
|
1
|
|
5
|
our @ISA = 'Sub::HandlesVia::Toolkit'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
278
|
|
12
|
|
|
|
|
|
|
$ISA[0]->VERSION( '0.025' ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $class = shift; |
15
|
|
|
|
|
|
|
bless { @_ } => $class; |
16
|
1
|
|
|
1
|
0
|
2
|
} |
17
|
1
|
|
|
|
|
3
|
|
18
|
|
|
|
|
|
|
shift->{attr}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
6
|
shift->{handles_map}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my ( $self, $target, $attr, $spec ) = @_; |
25
|
1
|
|
|
1
|
|
2
|
if ( 'ARRAY' eq ref $spec->{handles} ) { |
26
|
|
|
|
|
|
|
my %tmp = @{ $spec->{handles} }; |
27
|
|
|
|
|
|
|
$spec->{handles} = \%tmp; |
28
|
|
|
|
|
|
|
} |
29
|
1
|
|
|
1
|
0
|
2
|
return $self->SUPER::clean_spec( $target, $attr, $spec ); |
30
|
1
|
50
|
|
|
|
4
|
} |
31
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
32
|
1
|
|
|
|
|
2
|
my ( $self, $target, $attr ) = @_; |
33
|
|
|
|
|
|
|
my $realattr = $self->_attr; |
34
|
1
|
|
|
|
|
6
|
my $handles_map = $self->_handles_map; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
my $reader = $realattr->reader; |
38
|
1
|
|
|
1
|
0
|
13942
|
my $writer = $realattr->writer; |
39
|
1
|
|
|
|
|
2
|
my $default = |
40
|
1
|
|
|
|
|
3
|
ref($realattr->{default}) ? $realattr->{default} : |
41
|
|
|
|
|
|
|
length($realattr->{builder}) ? $realattr->{builder} : |
42
|
|
|
|
|
|
|
undef; |
43
|
1
|
|
|
|
|
1
|
$attr = [ $reader, $writer, $default ? $default : () ]; |
|
1
|
|
|
|
|
6
|
|
44
|
1
|
|
|
|
|
6
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $gen = $self->SUPER::code_generator_for_attribute( $target, $attr ); |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
5
|
$gen->method_installer( sub { |
|
|
50
|
|
|
|
|
|
49
|
1
|
50
|
|
|
|
3
|
my ( $method_name, $coderef ) = @_; |
50
|
|
|
|
|
|
|
my $real_destination = $handles_map->{$method_name}; |
51
|
|
|
|
|
|
|
$realattr->install_coderef( $real_destination, $coderef ); |
52
|
1
|
|
|
|
|
8
|
} ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
return $gen; |
55
|
2
|
|
|
2
|
|
9273
|
} |
56
|
2
|
|
|
|
|
5
|
|
57
|
2
|
|
|
|
|
10
|
1; |