line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cikl::Models::AddressRole; |
2
|
7
|
|
|
7
|
|
122
|
use strict; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
291
|
|
3
|
7
|
|
|
7
|
|
40
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
223
|
|
4
|
7
|
|
|
7
|
|
7496
|
use Mouse::Role; |
|
7
|
|
|
|
|
11272
|
|
|
7
|
|
|
|
|
38
|
|
5
|
7
|
|
|
7
|
|
10916
|
use namespace::autoclean; |
|
7
|
|
|
|
|
272920
|
|
|
7
|
|
|
|
|
50
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
requires 'type'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'value' => ( |
10
|
|
|
|
|
|
|
is => 'rw', |
11
|
|
|
|
|
|
|
isa => 'Str', |
12
|
|
|
|
|
|
|
required => 1 |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub as_string { |
16
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
17
|
0
|
|
|
|
|
0
|
return $self->value; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub to_hash { |
21
|
0
|
|
|
0
|
0
|
0
|
return { $_[0]->type => $_[0]->value }; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub normalize_value { |
25
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
26
|
0
|
|
|
|
|
0
|
return shift; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new_normalized { |
30
|
18
|
|
|
18
|
0
|
105
|
my $class = shift; |
31
|
18
|
|
|
|
|
55
|
my %args = @_; |
32
|
18
|
|
|
|
|
90
|
$args{value} = $class->normalize_value($args{value}); |
33
|
18
|
|
|
|
|
171
|
$class->new(%args); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |