blib/lib/Number/Phone/StubCountry/UY.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.3% 36 / 37 CC 3 SCAR 6.2
CC
3
Cov
97%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/Number/Phone/StubCountry/UG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/VE.pm »
1 # automatically generated file, don't edit
2  
3  
4  
5 # Copyright 2026 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::UY;
20 2 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 our $VERSION = 1.20260904101551;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1',
30 'leading_digits' => '21',
31 'pattern' => '(\\d{4,5})'
32 },
33 {
34 'format' => '$1 $2',
35 'pattern' => '(\\d{3})(\\d{3,4})'
36 },
37 {
38 'format' => '$1 $2',
39 'leading_digits' => '
40 [49]0|
41 8
42 ',
43 'national_rule' => '0$1',
44 'pattern' => '(\\d{3})(\\d{4})'
45 },
46 {
47 'format' => '$1 $2 $3',
48 'leading_digits' => '9',
49 'national_rule' => '0$1',
50 'pattern' => '(\\d{2})(\\d{3})(\\d{3})'
51 },
52 {
53 'format' => '$1 $2',
54 'leading_digits' => '[124]',
55 'pattern' => '(\\d{4})(\\d{4})'
56 },
57 {
58 'format' => '$1 $2 $3',
59 'pattern' => '(\\d{3})(\\d{3})(\\d{2,4})'
60 },
61 {
62 'format' => '$1 $2 $3 $4',
63 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})'
64 }
65 ];
66  
67 2 my $validators = {
68 'fixed_line' => '
69 (?:
70 1(?:
71 770|
72 9(?:
73 20|
74 [89]7
75 )
76 )|
77 (?:
78 2\\d|
79 4[2-7]
80 )\\d\\d
81 )\\d{4}
82 ',
83 'geographic' => '
84 (?:
85 1(?:
86 770|
87 9(?:
88 20|
89 [89]7
90 )
91 )|
92 (?:
93 2\\d|
94 4[2-7]
95 )\\d\\d
96 )\\d{4}
97 ',
98 'mobile' => '9[1-9]\\d{6}',
99 'pager' => '',
100 'personal_number' => '',
101 'specialrate' => '(90[0-8]\\d{4})|(21\\d{2,3})',
102 'toll_free' => '
103 0004\\d{2,9}|
104 (?:
105 405|
106 80[05]
107 )\\d{4}
108 ',
109 'voip' => ''
110 };
111 2 my %areanames = ();
112 2 $areanames{en} = {"598452", "Colonia\ del\ Scaramento",
113 "598477", "Artigas",
114 "598472", "Paysandu",
115 "598433", "Canelones",
116 "598462", "Rivera",
117 "598464", "Melo\/Cerro\ Largo",
118 "598456", "Fray\ Bentos\/Rio\ Negro",
119 "598473", "Salto",
120 "598463", "Tacuarembo",
121 "598434", "San\ Jose\ de\ Mayo",
122 "598445", "Treinta\ y\ Tres",
123 "598447", "Rocha",
124 "598436", "Durazno",
125 "5984364", "Trinidad\/Flores",
126 "598444", "Minas\/Lavalleja",
127 "5982", "Montevideo",
128 "598435", "Florida",
129 "598453", "Mercedes\/Soriano",
130 "59842", "San\ Carlos",};
131 2 my $timezones = {
132 '' => [
133 'America/Montevideo'
134 ]
135 };
136  
137 16 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
138 16 my $class = shift;
139 16 my $number = shift;
140 16 $number =~ s/(^\+598|\D)//g;
141 16 my $self = bless({ country_code => '598', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
142 16 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 15 1 16
143 1 $number =~ s/^(?:0)//;
144 1 $self = bless({ country_code => '598', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
145 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
146 }
147 2 1;
« blib/lib/Number/Phone/StubCountry/UG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/VE.pm »