Module: Faker::PhoneNumberFR
Constant Summary
collapse
- COUNTRY_PREFIX =
%w[+33 0033 0]
- AREA_PREFIX =
%w[1 2 3 4 5]
- MOBILE_PREFIX =
%w[6 7]
- PHONE_NUMBER =
['########', ' ## ## ## ##']
Instance Method Summary
collapse
const_missing, k, underscore
Instance Method Details
#home_work_phone_number ⇒ Object
20
21
22
|
# File 'lib/ffaker/phone_number_fr.rb', line 20
def home_work_phone_number
Faker.numerify "#{COUNTRY_PREFIX.sample}#{AREA_PREFIX.sample}#{PHONE_NUMBER.sample}"
end
|
#mobile_phone_number ⇒ Object
24
25
26
|
# File 'lib/ffaker/phone_number_fr.rb', line 24
def mobile_phone_number
Faker.numerify "#{COUNTRY_PREFIX.sample}#{MOBILE_PREFIX.sample}#{PHONE_NUMBER.sample}"
end
|
#phone_number ⇒ Object
13
14
15
16
17
18
|
# File 'lib/ffaker/phone_number_fr.rb', line 13
def phone_number
case rand(2)
when 0 then home_work_phone_number
when 1 then mobile_phone_number
end
end
|