File Coverage

blib/lib/Number/Phone/Lib.pm
Criterion Covered Total %
statement 12 12 100.0
branch 6 6 100.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Number::Phone::Lib;
2              
3 12     12   16866 use strict;
  12         56  
  12         371  
4 12     12   65 use base 'Number::Phone';
  12         25  
  12         1583  
5              
6             our $VERSION = '1.0';
7              
8             sub new {
9 3790     3790 1 2234510 my $class = shift;
10 3790         16311 my($country, $number) = $class->_new_args(@_);
11 3790 100       8595 return undef unless $country;
12              
13             # libphonenumber erroneously treats non-geographic numbers such
14             # as 1-800 numbers as being in the US
15 3786 100       8064 $country = 'US' if($country eq 'NANP');
16 3786 100       7074 $country = 'GB' if($country eq 'UK');
17              
18 3786         16257 return $class->_make_stub_object($number, $country);
19             }
20              
21             1;
22             __END__