line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Keyword::Field; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
211421
|
use 5.006; use strict; use warnings; our $VERSION = '0.02'; |
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
50
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
110
|
|
4
|
2
|
|
|
2
|
|
470
|
use Moo; |
|
2
|
|
|
|
|
9129
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our %FIELDS; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use MooX::Keyword { |
9
|
|
|
|
|
|
|
field => { |
10
|
|
|
|
|
|
|
builder => sub { |
11
|
2
|
|
|
|
|
16745
|
my ($moo, $name, @args) = @_; |
12
|
|
|
|
|
|
|
$moo->around('BUILDARGS', sub { |
13
|
1
|
|
|
|
|
924
|
my ($orig, $self, @args) = @_; |
14
|
1
|
50
|
|
|
|
5
|
my %args = scalar @args > 1 ? @args : %{$args[0] || {}}; |
|
1
|
50
|
|
|
|
7
|
|
15
|
1
|
|
|
|
|
3
|
for (keys %args) { |
16
|
3
|
100
|
|
|
|
8
|
delete $args{$_} if $FIELDS{$_}; |
17
|
|
|
|
|
|
|
} |
18
|
1
|
|
|
|
|
5
|
$self->$orig(\%args); |
19
|
2
|
100
|
|
|
|
30
|
}) if ! keys %FIELDS; |
20
|
2
|
50
|
|
|
|
1949
|
if (! $FIELDS{$name} ) { |
21
|
2
|
|
|
|
|
44
|
$moo->has($name, is => 'ro', @args); |
22
|
2
|
|
|
|
|
561
|
$FIELDS{$name} = 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
2
|
|
|
2
|
|
2189
|
}; |
|
2
|
|
|
|
|
9944
|
|
|
2
|
|
|
|
|
24
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |