blib/lib/Number/Phone/Formatter/National.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Number/Phone/Formatter/MSISDN.pm ↑ Summary blib/lib/Number/Phone/Formatter/NationallyPreferredIntl.pm »
1 package Number::Phone::Formatter::National;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use parent 'Number::Phone::Formatter';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use Scalar::Util qw(reftype);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 our $VERSION = '1.0';
9  
10 16 ▶sub format {
Subroutine format: called CC=1 SCAR=0.0
Pod documented
11 16 my ($class, $number, $object) = @_;
12  
13 16 $class->_format($object, 1);
14 }
15  
16 6 1;
17  
18 =head1 NAME
19  
20 Number::Phone::Formatter::National - formatter for nationally-formatted phone number
21  
22 =head1 DESCRIPTION
23  
24 A formatter to output the number in its national format.
25  
26 =head1 METHOD
27  
28 =head2 format
29  
30 This is the only method. It takes an E.123 international format string and a Number::Phone object,
31 and outputs the nationally-formatted number.
32  
33 +1 212 334 0611 -> 212-334-0611
34  
35 Note that this uses data derived from libphonenumber, and if your object is
36 not derived from that it will first create a temporary object. This may
37 involve a small unexpected performance hit.
38  
39 =head1 AUTHOR, COPYRIGHT and LICENCE
40  
41 Copyright 2018 Matthew Somerville E<lt>F<matthew-github@dracos.co.uk>E<gt>
42  
43 This software is free-as-in-speech software, and may be used,
44 distributed, and modified under the terms of either the GNU
45 General Public Licence version 2 or the Artistic Licence. It's
46 up to you which one you use. The full text of the licences can
47 be found in the files GPL2.txt and ARTISTIC.txt, respectively.
48  
49 =cut
« blib/lib/Number/Phone/Formatter/MSISDN.pm ↑ Summary blib/lib/Number/Phone/Formatter/NationallyPreferredIntl.pm »