line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::ChainedAttributes::Role::GenerateAccessor; |
2
|
1
|
|
|
1
|
|
538
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
5
|
use strictures 2; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
35
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
205
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
around is_simple_set => sub { |
9
|
|
|
|
|
|
|
my $orig = shift; |
10
|
|
|
|
|
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
my ($attr, $spec) = @_; |
12
|
|
|
|
|
|
|
return 0 |
13
|
|
|
|
|
|
|
if $spec->{chained}; |
14
|
|
|
|
|
|
|
$self->$orig(@_); |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
around _generate_set => sub { |
18
|
|
|
|
|
|
|
my $orig = shift; |
19
|
|
|
|
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
my ($attr, $spec) = @_; |
21
|
|
|
|
|
|
|
my $chained = $spec->{chained}; |
22
|
|
|
|
|
|
|
local $spec->{chained}; |
23
|
|
|
|
|
|
|
my $set = $self->$orig(@_); |
24
|
|
|
|
|
|
|
return $set |
25
|
|
|
|
|
|
|
if !$chained; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
"(scalar ($set, \$_[0]))"; |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |