line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GeoIP2::Role::Record::HasNames; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
4758
|
use strict; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
279
|
|
4
|
12
|
|
|
12
|
|
49
|
use warnings; |
|
12
|
|
|
|
|
19
|
|
|
12
|
|
|
|
|
368
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.006002'; |
7
|
|
|
|
|
|
|
|
8
|
12
|
|
|
12
|
|
49
|
use Moo::Role; |
|
12
|
|
|
|
|
32
|
|
|
12
|
|
|
|
|
58
|
|
9
|
|
|
|
|
|
|
|
10
|
12
|
|
|
12
|
|
3370
|
use GeoIP2::Types qw( MaybeStr NameHashRef ); |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
566
|
|
11
|
12
|
|
|
12
|
|
63
|
use List::Util qw( first ); |
|
12
|
|
|
|
|
28
|
|
|
12
|
|
|
|
|
690
|
|
12
|
12
|
|
|
12
|
|
68
|
use Sub::Quote qw( quote_sub ); |
|
12
|
|
|
|
|
19
|
|
|
12
|
|
|
|
|
422
|
|
13
|
|
|
|
|
|
|
|
14
|
12
|
|
|
12
|
|
73
|
use namespace::clean; |
|
12
|
|
|
|
|
34
|
|
|
12
|
|
|
|
|
73
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
with 'GeoIP2::Role::HasLocales'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has name => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => MaybeStr, |
21
|
|
|
|
|
|
|
lazy => 1, |
22
|
|
|
|
|
|
|
builder => '_build_name', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has names => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => NameHashRef, |
28
|
|
|
|
|
|
|
default => quote_sub(q{ {} }), |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _build_name { |
32
|
15
|
|
|
15
|
|
14857
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
15
|
|
|
|
|
39
|
my $names = $self->names(); |
35
|
|
|
|
|
|
|
|
36
|
15
|
|
|
17
|
|
52
|
my $lang = first { exists $names->{$_} } @{ $self->locales() }; |
|
17
|
|
|
|
|
38
|
|
|
15
|
|
|
|
|
59
|
|
37
|
|
|
|
|
|
|
|
38
|
15
|
100
|
|
|
|
90
|
return unless $lang; |
39
|
12
|
|
|
|
|
169
|
return $names->{$lang}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |