File Coverage

blib/lib/Geo/Location/IP/Record/Continent.pm
Criterion Covered Total %
statement 28 30 93.3
branch n/a
condition 5 6 83.3
subroutine 9 10 90.0
pod 1 2 50.0
total 43 48 89.5


line stmt bran cond sub pod time code
1             package Geo::Location::IP::Record::Continent;
2              
3             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
4              
5 14     14   120467 use 5.026;
  14         68  
6 14     14   70 use warnings;
  14         20  
  14         671  
7 14     14   69 use utf8;
  14         29  
  14         73  
8              
9 14     14   1146 use Object::Pad;
  14         14969  
  14         74  
10              
11             class Geo::Location::IP::Record::Continent;
12              
13             our $VERSION = 0.005;
14              
15 2     2   1950 apply Geo::Location::IP::Role::Record::HasGeoNameId;
  2         6  
  2         89  
16 2     2   909 apply Geo::Location::IP::Role::Record::HasNames;
  2         5  
  2         521  
17              
18             field $code :param :reader = undef;
19              
20 9     9 1 24 sub _from_hash ($class, $hash_ref, $locales) {
  9     3   22  
  9         21  
  9         21  
  9         17  
  3         12  
  3         23  
21             return $class->new(
22             names => $hash_ref->{names} // {},
23             geoname_id => $hash_ref->{geoname_id} // undef,
24             code => $hash_ref->{code} // undef,
25 9   50     186 locales => $locales,
      100        
      100        
26             );
27             }
28              
29             use overload
30 14     14   8335 q{""} => \&stringify;
  14         4870  
  14         97  
31              
32             sub stringify {
33 0     0 0 0 my $self = shift;
34              
35 0         0 return $self->name;
36             }
37              
38             1;
39             __END__