| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Geo::Location::IP::Record::Location; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later |
|
4
|
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
146871
|
use 5.026; |
|
|
13
|
|
|
|
|
44
|
|
|
6
|
13
|
|
|
13
|
|
65
|
use warnings; |
|
|
13
|
|
|
|
|
25
|
|
|
|
13
|
|
|
|
|
655
|
|
|
7
|
13
|
|
|
13
|
|
89
|
use utf8; |
|
|
13
|
|
|
|
|
24
|
|
|
|
13
|
|
|
|
|
69
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
13
|
|
|
13
|
|
1205
|
use Object::Pad; |
|
|
13
|
|
|
|
|
17143
|
|
|
|
13
|
|
|
|
|
109
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
class Geo::Location::IP::Record::Location; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.005; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
field $accuracy_radius :param :reader = undef; |
|
16
|
2
|
|
|
2
|
1
|
1488
|
field $average_income :param :reader = undef; |
|
|
2
|
|
|
|
|
13
|
|
|
17
|
2
|
|
|
2
|
1
|
12
|
field $latitude :param :reader = undef; |
|
|
2
|
|
|
|
|
13
|
|
|
18
|
3
|
|
|
3
|
1
|
18
|
field $longitude :param :reader = undef; |
|
|
3
|
|
|
|
|
29
|
|
|
19
|
3
|
|
|
3
|
1
|
25
|
field $metro_code :param :reader = undef; |
|
|
3
|
|
|
|
|
22
|
|
|
20
|
1
|
|
|
1
|
1
|
6
|
field $population_density :param :reader = undef; |
|
|
1
|
|
|
|
|
8
|
|
|
21
|
2
|
|
|
2
|
1
|
10
|
field $time_zone :param :reader = undef; |
|
|
2
|
|
|
|
|
11
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
7
|
|
|
7
|
1
|
18
|
sub _from_hash ($class, $hash_ref) { |
|
|
7
|
|
|
2
|
|
18
|
|
|
|
7
|
|
|
|
|
18
|
|
|
|
7
|
|
|
|
|
16
|
|
|
|
2
|
|
|
|
|
10
|
|
|
|
2
|
|
|
|
|
12
|
|
|
24
|
|
|
|
|
|
|
return $class->new( |
|
25
|
|
|
|
|
|
|
accuracy_radius => $hash_ref->{accuracy_radius} // undef, |
|
26
|
|
|
|
|
|
|
average_income => $hash_ref->{average_income} // undef, |
|
27
|
|
|
|
|
|
|
latitude => $hash_ref->{latitude} // undef, |
|
28
|
|
|
|
|
|
|
longitude => $hash_ref->{longitude} // undef, |
|
29
|
|
|
|
|
|
|
metro_code => $hash_ref->{metro_code} // undef, |
|
30
|
|
|
|
|
|
|
population_density => $hash_ref->{population_density} // undef, |
|
31
|
|
|
|
|
|
|
time_zone => $hash_ref->{time_zone} // undef, |
|
32
|
7
|
|
100
|
|
|
272
|
); |
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
use overload |
|
36
|
13
|
|
|
13
|
|
14875
|
q{""} => \&stringify; |
|
|
13
|
|
|
|
|
3596
|
|
|
|
13
|
|
|
|
|
96
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub stringify { |
|
39
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
40
|
|
|
|
|
|
|
|
|
41
|
0
|
0
|
0
|
|
|
|
if (defined $self->latitude && defined $self->longitude) { |
|
42
|
0
|
|
|
|
|
|
return sprintf "%g, %g", $self->latitude, $self->longitude; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
0
|
|
|
|
|
|
return; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
|
48
|
|
|
|
|
|
|
__END__ |