File Coverage

blib/lib/Number/Phone/StubCountry/GN.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 25 25 100.0


line stmt bran cond sub pod time code
1             # automatically generated file, don't edit
2              
3              
4              
5             # Copyright 2023 David Cantrell, derived from data from libphonenumber
6             # http://code.google.com/p/libphonenumber/
7             #
8             # Licensed under the Apache License, Version 2.0 (the "License");
9             # you may not use this file except in compliance with the License.
10             # You may obtain a copy of the License at
11             #
12             # http://www.apache.org/licenses/LICENSE-2.0
13             #
14             # Unless required by applicable law or agreed to in writing, software
15             # distributed under the License is distributed on an "AS IS" BASIS,
16             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17             # See the License for the specific language governing permissions and
18             # limitations under the License.
19             package Number::Phone::StubCountry::GN;
20 2     2   1378 use base qw(Number::Phone::StubCountry);
  2         8  
  2         267  
21              
22 2     2   16 use strict;
  2         6  
  2         57  
23 2     2   12 use warnings;
  2         6  
  2         61  
24 2     2   16 use utf8;
  2         7  
  2         14  
25             our $VERSION = 1.20230307181420;
26              
27             my $formatters = [
28             {
29             'format' => '$1 $2 $3 $4',
30             'leading_digits' => '3',
31             'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})'
32             },
33             {
34             'format' => '$1 $2 $3 $4',
35             'leading_digits' => '[67]',
36             'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})'
37             }
38             ];
39              
40             my $validators = {
41             'fixed_line' => '
42             3(?:
43             0(?:
44             24|
45             3[12]|
46             4[1-35-7]|
47             5[13]|
48             6[189]|
49             [78]1|
50             9[1478]
51             )|
52             1\\d\\d
53             )\\d{4}
54             ',
55             'geographic' => '
56             3(?:
57             0(?:
58             24|
59             3[12]|
60             4[1-35-7]|
61             5[13]|
62             6[189]|
63             [78]1|
64             9[1478]
65             )|
66             1\\d\\d
67             )\\d{4}
68             ',
69             'mobile' => '6[0-356]\\d{7}',
70             'pager' => '',
71             'personal_number' => '',
72             'specialrate' => '',
73             'toll_free' => '',
74             'voip' => '722\\d{6}'
75             };
76             my %areanames = ();
77             $areanames{en} = {"2243046", "Boussoura",
78             "2243043", "Conakry",
79             "2243031", "Boké",
80             "22430613", "Télimélé",
81             "2243051", "Labé",
82             "2243045", "Conakry",
83             "2243032", "Kamsar",
84             "2243094", "Macenta",
85             "2243098", "Kissidougou",
86             "2243068", "Mamou",
87             "2243053", "Pita",
88             "2243069", "Dalaba",
89             "2243042", "Sangoya",
90             "2243047", "Conakry",
91             "2243097", "Guéckédou",
92             "224308", "Faranah",
93             "224302", "Fria",
94             "224307", "Kankan",
95             "2243041", "Conakry",
96             "2243091", "N\'Zérékoré",
97             "2243061", "Kindia",};
98              
99             sub new {
100 10     10 1 28 my $class = shift;
101 10         21 my $number = shift;
102 10         63 $number =~ s/(^\+224|\D)//g;
103 10         53 my $self = bless({ country_code => '224', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
104 10 100       50 return $self->is_valid() ? $self : undef;
105             }
106             1;