Class: Faker::PhoneNumber

Inherits:
Object
  • Object
show all
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

Class Method Details

.fr_cellphone_numberObject



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_intlObject



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_numberObject



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_intlObject



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