line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mew; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
176091
|
use strictures 2; |
|
2
|
|
|
|
|
2416
|
|
|
2
|
|
|
|
|
58
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.002002'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
961
|
use Import::Into; |
|
2
|
|
|
|
|
3839
|
|
|
2
|
|
|
|
|
41
|
|
8
|
2
|
|
|
2
|
|
770
|
use Moo; |
|
2
|
|
|
|
|
12809
|
|
|
2
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
2
|
|
|
2
|
|
12
|
my $class = shift; |
12
|
2
|
|
|
|
|
12
|
strictures->import::into(1); |
13
|
2
|
|
|
|
|
465
|
Moo->import::into(1); |
14
|
2
|
|
|
|
|
585
|
MooX->import::into(1, $_) for @_; |
15
|
2
|
|
|
|
|
8
|
MooX::ChainedAttributes->import::into(1); |
16
|
2
|
|
|
|
|
42803
|
Types::Standard->import::into(1, qw/:all/); |
17
|
2
|
|
|
|
|
187248
|
Types::Common::Numeric->import::into(1, qw/:all/); |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
29160
|
my $target = caller; |
20
|
2
|
|
|
|
|
33
|
my $moo_has = $target->can('has'); |
21
|
|
|
|
|
|
|
Moo::_install_tracked $target => has => sub { |
22
|
16
|
|
|
16
|
|
33240
|
my $name_proto = shift; |
23
|
16
|
100
|
|
|
|
40
|
my @name_proto = ref $name_proto eq 'ARRAY' |
24
|
|
|
|
|
|
|
? @$name_proto : $name_proto; |
25
|
|
|
|
|
|
|
|
26
|
16
|
|
|
|
|
21
|
my $req = 1; |
27
|
16
|
|
|
|
|
13
|
my $mew_type; |
28
|
16
|
100
|
|
|
|
37
|
$mew_type = shift if @_ % 2 != 0; |
29
|
16
|
100
|
100
|
|
|
106
|
if ($mew_type and $mew_type->is_parameterized and $mew_type->parent == Types::Standard::Optional()) { |
|
|
50
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
30
|
4
|
|
|
|
|
181
|
$req = 0; |
31
|
4
|
|
|
|
|
10
|
$mew_type = $mew_type->type_parameter; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
elsif ($mew_type and $mew_type == Types::Standard::Optional()) { |
34
|
0
|
|
|
|
|
0
|
$req = 0; |
35
|
0
|
|
|
|
|
0
|
$mew_type = Types::Standard::Any(); |
36
|
|
|
|
|
|
|
} |
37
|
16
|
|
|
|
|
2206
|
for my $attr ( @name_proto ) { |
38
|
18
|
|
|
|
|
567
|
my %spec = @_; |
39
|
18
|
100
|
|
|
|
33
|
if ( $mew_type ) { |
40
|
16
|
|
|
|
|
53
|
my %mew_spec; |
41
|
16
|
100
|
|
|
|
47
|
$mew_spec{required} = $req unless $attr =~ s/^-//; |
42
|
|
|
|
|
|
|
( $mew_spec{init_arg} = $attr ) =~ s/^_// |
43
|
16
|
100
|
|
|
|
46
|
unless exists $spec{init_arg}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
%spec = ( |
46
|
16
|
100
|
|
|
|
73
|
is => $spec{chained} ? 'rw' : 'ro' , |
47
|
|
|
|
|
|
|
isa => $mew_type, |
48
|
|
|
|
|
|
|
%mew_spec, |
49
|
|
|
|
|
|
|
%spec, |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
} |
52
|
18
|
|
|
|
|
50
|
$moo_has->( $attr => %spec ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
16
|
|
|
|
|
18195
|
return; |
56
|
2
|
|
|
|
|
19
|
}; |
57
|
|
|
|
|
|
|
|
58
|
2
|
|
|
|
|
80
|
namespace::clean->import::into(1); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
q| |
62
|
|
|
|
|
|
|
To err is human -- and to blame it on a computer is even more so |
63
|
|
|
|
|
|
|
|; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |