|
our $VERSION = 1.20250323211832;
my $formatters = [
{
'format' => '$1 $2 $3 $4' ,
'leading_digits' => '[2-48]' ,
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})'
}
];
my $validators = {
'fixed_line' => '
(?:
25[08]|
35\\d|
45[1-7]
)\\d{5}
',
'geographic' => '
(?:
25[08]|
35\\d|
45[1-7]
)\\d{5}
',
'mobile' => '[2-4][0-46-9]\\d{6}' ,
'pager' => '' ,
'personal_number' => '' ,
'specialrate' => '' ,
'toll_free' => '800\\d{5}' ,
'voip' => ''
};
my %areanames = ();
$areanames {en} = { "2224550" , "Boghé" ,
"2224537" , "Aleg" ,
"2224569" , "Rosso\/Tidjikja" ,
"2224544" , "Zouérat" ,
"22245" , "Nouakchott" ,
"2224534" , "Sélibaby" ,
"2224513" , "Néma" ,
"2224515" , "Aioun" ,
"2224574" , "Nouadhibou" ,
"2224546" , "Atar" ,
"2224563" , "Kiffa" ,
"2224533" , "Kaédi" ,};
$areanames {fr} = { "2224515" , "Aîoun" ,};
my $timezones = {
'' => [
'Africa/Nouakchott'
]
};
sub new {
my $class = shift ;
my $number = shift ;
$number =~ s/(^\+222|\D)//g;
my $self = bless ({ country_code => '222' , number => $number , formatters => $formatters , validators => $validators , timezones => $timezones , areanames => \ %areanames }, $class );
return $self ->is_valid() ? $self : undef ;
}
1;
|