Class: Faker::PhoneNumber
- Inherits:
-
Object
- Object
- Faker::PhoneNumber
- Defined in:
- lib/faker_extension_fr/phone_number.rb
Constant Summary collapse
- Phone_formats_fr =
[ '01 ## ### ###', '02 ## ### ###', '03 ## ### ###', '04 ## ### ###', '05 ## ### ###' ]
- Phone_formats_fr_intl =
[ '+33(0)1 ## ### ###', '+33(0)2 ## ### ###', '+33(0)3 ## ### ###', '+33(0)4 ## ### ###', '+33(0)5 ## ### ###' ]
- Cellphone_formats_fr_intl =
[ '+33(0)6 ## ### ###' ]
- Cellphone_formats_fr =
[ '06 ## ### ###' ]
Class Method Summary collapse
- .fr_cellphone_number ⇒ Object
- .fr_cellphone_number_intl ⇒ Object
- .fr_phone_number ⇒ Object
- .fr_phone_number_in_departement(departement = nil) ⇒ Object
- .fr_phone_number_in_region(region = nil) ⇒ Object
- .fr_phone_number_intl ⇒ Object
- .fr_phone_number_intl_in_departement(departement = nil) ⇒ Object
- .fr_phone_number_intl_in_region(region = nil) ⇒ Object
Class Method Details
.fr_cellphone_number ⇒ Object
37 38 39 |
# File 'lib/faker_extension_fr/phone_number.rb', line 37 def fr_cellphone_number Faker::Base.numerify(Cellphone_formats_fr.sample) end |
.fr_cellphone_number_intl ⇒ Object
34 35 36 |
# File 'lib/faker_extension_fr/phone_number.rb', line 34 def fr_cellphone_number_intl Faker::Base.numerify(Cellphone_formats_fr_intl.sample) end |
.fr_phone_number ⇒ Object
6 7 8 9 |
# File 'lib/faker_extension_fr/phone_number.rb', line 6 def fr_phone_number phone_area_code = Faker::Address.fr_zip_and_city_in_region[4].to_i Faker::Base.numerify(Phone_formats_fr[phone_area_code - 1]) end |
.fr_phone_number_in_departement(departement = nil) ⇒ Object
24 25 26 27 |
# File 'lib/faker_extension_fr/phone_number.rb', line 24 def fr_phone_number_in_departement(departement=nil) phone_area_code = Faker::Address.fr_zip_and_city_in_area(departement)[4].to_i Faker::Base.numerify(Phone_formats_fr[phone_area_code - 1]) end |
.fr_phone_number_in_region(region = nil) ⇒ Object
15 16 17 18 |
# File 'lib/faker_extension_fr/phone_number.rb', line 15 def fr_phone_number_in_region(region=nil) phone_area_code = Faker::Address.fr_zip_and_city_in_region(region)[4].to_i Faker::Base.numerify(Phone_formats_fr[phone_area_code - 1]) end |
.fr_phone_number_intl ⇒ Object
10 11 12 13 |
# File 'lib/faker_extension_fr/phone_number.rb', line 10 def fr_phone_number_intl phone_area_code = Faker::Address.fr_zip_and_city_in_region[4].to_i Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1]) end |
.fr_phone_number_intl_in_departement(departement = nil) ⇒ Object
28 29 30 31 |
# File 'lib/faker_extension_fr/phone_number.rb', line 28 def fr_phone_number_intl_in_departement(departement=nil) phone_area_code = Faker::Address.fr_zip_and_city_in_area(departement)[4].to_i Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1]) end |
.fr_phone_number_intl_in_region(region = nil) ⇒ Object
19 20 21 22 |
# File 'lib/faker_extension_fr/phone_number.rb', line 19 def fr_phone_number_intl_in_region(region=nil) phone_area_code = Faker::Address.fr_zip_and_city_in_region(region)[4].to_i Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1]) end |