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