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   17054 use strict;
  12         53  
  12         384  
4 12     12   68 use base 'Number::Phone';
  12         24  
  12         1614  
5              
6             our $VERSION = '1.0';
7              
8             sub new {
9 3790     3790 1 2222052 my $class = shift;
10 3790         17079 my($country, $number) = $class->_new_args(@_);
11 3790 100       8822 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       7712 $country = 'US' if($country eq 'NANP');
16 3786 100       7343 $country = 'GB' if($country eq 'UK');
17              
18 3786         16451 return $class->_make_stub_object($number, $country);
19             }
20              
21             1;
22             __END__