| 1 | package Faker::Plugin::EsEs::TelephoneNumber; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.018; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use Venus::Class 'base'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | base 'Faker::Plugin::EsEs'; | |
| 11 | |||
| 12 | # VERSION | ||
| 13 | |||
| 14 | 1 | our $VERSION = '1.19'; | |
| 15 | |||
| 16 | # METHODS | ||
| 17 | |||
| 18 | 3 | ▶ | sub execute { |
|
Subroutine
execute: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 3 | my ($self, $data) = @_; | |
| 20 | |||
| 21 | 3 | my $method = $self->faker->random->select( | |
| 22 | [ | ||
| 23 | 'data_for_telephone_number', | ||
| 24 | 'data_for_telephone_number_mobile', | ||
| 25 | 'data_for_telephone_number_tollfree' | ||
| 26 | ] | ||
| 27 | ); | ||
| 28 | |||
| 29 | 3 | return $self->process_markers( | |
| 30 | $self->faker->random->select($self->$method), | ||
| 31 | 'numbers' | ||
| 32 | ); | ||
| 33 | } | ||
| 34 | |||
| 35 | 1 | ▶ | sub data_for_telephone_number { |
|
Subroutine
data_for_telephone_number: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 36 | 1 | state $telephone_number = [ | |
| 37 | '+34 9## ## ####', | ||
| 38 | '+34 9## ######', | ||
| 39 | '+34 9########', | ||
| 40 | '+34 9##-##-####', | ||
| 41 | '+34 9##-######', | ||
| 42 | '9## ## ####', | ||
| 43 | '9## ######', | ||
| 44 | '9########', | ||
| 45 | '9##-##-####', | ||
| 46 | '9##-######', | ||
| 47 | ] | ||
| 48 | } | ||
| 49 | |||
| 50 | 2 | ▶ | sub data_for_telephone_number_mobile { |
|
Subroutine
data_for_telephone_number_mobile: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 51 | 2 | state $telephone_number = [ | |
| 52 | '+34 6## ## ####', | ||
| 53 | '+34 6## ######', | ||
| 54 | '+34 6########', | ||
| 55 | '+34 6##-##-####', | ||
| 56 | '+34 6##-######', | ||
| 57 | '6## ## ####', | ||
| 58 | '6## ######', | ||
| 59 | '6########', | ||
| 60 | '6##-##-####', | ||
| 61 | '6##-######', | ||
| 62 | ] | ||
| 63 | } | ||
| 64 | |||
| 65 | 0 | ▶ | sub data_for_telephone_number_tollfree { |
|
Subroutine
data_for_telephone_number_tollfree: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 66 | 0 | state $telephone_number = [ | |
| 67 | '900 ### ###', | ||
| 68 | '800 ### ###', | ||
| 69 | ] | ||
| 70 | } | ||
| 71 | |||
| 72 | 1 | 1; | |
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | =head1 NAME | ||
| 77 | |||
| 78 | Faker::Plugin::EsEs::TelephoneNumber - Telephone Number | ||
| 79 | |||
| 80 | =cut | ||
| 81 | |||
| 82 | =head1 ABSTRACT | ||
| 83 | |||
| 84 | Telephone Number for Faker | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | =head1 VERSION | ||
| 89 | |||
| 90 | 1.19 | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | =head1 SYNOPSIS | ||
| 95 | |||
| 96 | package main; | ||
| 97 | |||
| 98 | use Faker::Plugin::EsEs::TelephoneNumber; | ||
| 99 | |||
| 100 | my $plugin = Faker::Plugin::EsEs::TelephoneNumber->new; | ||
| 101 | |||
| 102 | # bless(..., "Faker::Plugin::EsEs::TelephoneNumber") | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | =head1 DESCRIPTION | ||
| 107 | |||
| 108 | This package provides methods for generating fake data for telephone number. | ||
| 109 | |||
| 110 | =encoding utf8 | ||
| 111 | |||
| 112 | =cut | ||
| 113 | |||
| 114 | =head1 INHERITS | ||
| 115 | |||
| 116 | This package inherits behaviors from: | ||
| 117 | |||
| 118 | L<Faker::Plugin::EsEs> | ||
| 119 | |||
| 120 | =cut | ||
| 121 | |||
| 122 | =head1 METHODS | ||
| 123 | |||
| 124 | This package provides the following methods: | ||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | =head2 execute | ||
| 129 | |||
| 130 | execute(HashRef $data) (Str) | ||
| 131 | |||
| 132 | The execute method returns a returns a random fake telephone number. | ||
| 133 | |||
| 134 | I<Since C<1.10>> | ||
| 135 | |||
| 136 | =over 4 | ||
| 137 | |||
| 138 | =item execute example 1 | ||
| 139 | |||
| 140 | package main; | ||
| 141 | |||
| 142 | use Faker::Plugin::EsEs::TelephoneNumber; | ||
| 143 | |||
| 144 | my $plugin = Faker::Plugin::EsEs::TelephoneNumber->new; | ||
| 145 | |||
| 146 | # bless(..., "Faker::Plugin::EsEs::TelephoneNumber") | ||
| 147 | |||
| 148 | # my $result = $plugin->execute; | ||
| 149 | |||
| 150 | # '+34 640 844684'; | ||
| 151 | |||
| 152 | # my $result = $plugin->execute; | ||
| 153 | |||
| 154 | # '+34 676 94 5443'; | ||
| 155 | |||
| 156 | # my $result = $plugin->execute; | ||
| 157 | |||
| 158 | # '998-22-0370'; | ||
| 159 | |||
| 160 | =back | ||
| 161 | |||
| 162 | =cut | ||
| 163 | |||
| 164 | =head2 new | ||
| 165 | |||
| 166 | new(HashRef $data) (Plugin) | ||
| 167 | |||
| 168 | The new method returns a new instance of the class. | ||
| 169 | |||
| 170 | I<Since C<1.10>> | ||
| 171 | |||
| 172 | =over 4 | ||
| 173 | |||
| 174 | =item new example 1 | ||
| 175 | |||
| 176 | package main; | ||
| 177 | |||
| 178 | use Faker::Plugin::EsEs::TelephoneNumber; | ||
| 179 | |||
| 180 | my $plugin = Faker::Plugin::EsEs::TelephoneNumber->new; | ||
| 181 | |||
| 182 | # bless(..., "Faker::Plugin::EsEs::TelephoneNumber") | ||
| 183 | |||
| 184 | =back | ||
| 185 | |||
| 186 | =cut | ||
| 187 | |||
| 188 | =head1 AUTHORS | ||
| 189 | |||
| 190 | Awncorp, C<awncorp@cpan.org> | ||
| 191 | |||
| 192 | =cut | ||
| 193 | |||
| 194 | =head1 LICENSE | ||
| 195 | |||
| 196 | Copyright (C) 2000, Al Newkirk. | ||
| 197 | |||
| 198 | This program is free software, you can redistribute it and/or modify it under | ||
| 199 | the terms of the Apache license version 2.0. | ||
| 200 | |||
| 201 | =cut | ||