File Coverage

blib/lib/Geo/Location/IP/Record/Postal.pm
Criterion Covered Total %
statement 24 26 92.3
branch n/a
condition 4 4 100.0
subroutine 8 9 88.8
pod 1 2 50.0
total 37 41 90.2


line stmt bran cond sub pod time code
1             package Geo::Location::IP::Record::Postal;
2              
3             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
4              
5 13     13   129390 use 5.026;
  13         43  
6 13     13   65 use warnings;
  13         25  
  13         616  
7 13     13   63 use utf8;
  13         24  
  13         65  
8              
9 13     13   1156 use Object::Pad;
  13         15052  
  13         63  
10              
11             class Geo::Location::IP::Record::Postal;
12              
13             our $VERSION = 0.005;
14              
15 1     1   1148 apply Geo::Location::IP::Role::Record::HasConfidence;
  1         3  
  1         280  
16              
17             field $code :param :reader = undef;
18              
19 7     7 1 16 sub _from_hash ($class, $hash_ref) {
  7     2   16  
  7         17  
  7         15  
  2         1237  
  2         14  
20             return $class->new(
21             code => $hash_ref->{code} // undef,
22             confidence => $hash_ref->{confidence} // undef,
23 7   100     186 );
      100        
24             }
25              
26             use overload
27 13     13   8088 q{""} => \&stringify;
  13         3138  
  13         111  
28              
29             sub stringify {
30 0     0 0 0 my $self = shift;
31              
32 0         0 return $self->code;
33             }
34              
35             1;
36             __END__