line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Keyword::Factory; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
220214
|
use 5.006; use strict; use warnings; our $VERSION = '0.02'; |
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
2
|
|
8
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
86
|
|
4
|
2
|
|
|
2
|
|
731
|
use Factory::Sub; use Moo; |
|
2
|
|
|
2
|
|
140412
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
640
|
|
|
2
|
|
|
|
|
7771
|
|
|
2
|
|
|
|
|
13
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our %FACTORY; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use MooX::Keyword { |
9
|
|
|
|
|
|
|
factory => { |
10
|
|
|
|
|
|
|
builder => sub { |
11
|
2
|
|
|
|
|
150
|
my ($moo, $name, @args) = @_; |
12
|
2
|
100
|
|
|
|
10
|
if (! $FACTORY{$name}) { |
13
|
1
|
|
|
|
|
21
|
$moo->has($name, is => 'rw'); |
14
|
|
|
|
|
|
|
$moo->around($name, sub { |
15
|
3
|
|
|
|
|
6292
|
my ($orig, $self, @args) = @_; |
16
|
3
|
100
|
|
|
|
20
|
$self->$orig(scalar @args ? $FACTORY{$name}->(@args) : ()); |
17
|
1
|
|
|
|
|
16922
|
}); |
18
|
1
|
|
|
|
|
1992
|
$FACTORY{$name} = Factory::Sub->new(); |
19
|
|
|
|
|
|
|
} |
20
|
2
|
|
|
|
|
14
|
$FACTORY{$name}->add(@args); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
2
|
|
|
2
|
|
2307
|
}; |
|
2
|
|
|
|
|
10949
|
|
|
2
|
|
|
|
|
34
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |