File Coverage

blib/lib/Geo/Location/IP/Record/City.pm
Criterion Covered Total %
statement 29 31 93.5
branch n/a
condition 5 6 83.3
subroutine 9 10 90.0
pod 0 1 0.0
total 43 48 89.5


line stmt bran cond sub pod time code
1             package Geo::Location::IP::Record::City;
2              
3             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
4              
5 13     13   125778 use 5.026;
  13         41  
6 13     13   60 use warnings;
  13         20  
  13         580  
7 13     13   231 use utf8;
  13         50  
  13         134  
8              
9 13     13   946 use Object::Pad;
  13         9971  
  13         59  
10              
11             class Geo::Location::IP::Record::City;
12              
13             our $VERSION = 0.005;
14              
15 13     13   10700 apply Geo::Location::IP::Role::Record::HasConfidence;
  13         36  
  13         554  
16 13     13   6025 apply Geo::Location::IP::Role::Record::HasGeoNameId;
  13         30  
  13         552  
17 13     13   5804 apply Geo::Location::IP::Role::Record::HasNames;
  13         35  
  13         2500  
18              
19 7     7   25 sub _from_hash ($class, $hash_ref, $locales) {
  7         20  
  7         17  
  7         14  
  7         16  
20             return $class->new(
21             names => $hash_ref->{names} // {},
22             confidence => $hash_ref->{confidence} // undef,
23             geoname_id => $hash_ref->{geoname_id} // undef,
24 7   50     292 locales => $locales,
      100        
      100        
25             );
26             }
27              
28             use overload
29 13     13   1294 q{""} => \&stringify;
  13         6462  
  13         123  
30              
31             sub stringify {
32 0     0 0   my $self = shift;
33              
34 0           return $self->name;
35             }
36              
37             1;
38             __END__