module FFaker::PhoneNumberFR
Constants
- AREA_PREFIX
- COUNTRY_CODE
- HOME_WORK_PHONE_PREFIX
- MOBILE_PHONE_PREFIX
- NON_AREA_PREFIX
- PHONE_NUMBER
- PHONE_PREFIX
Public Instance Methods
Source
# File lib/ffaker/phone_number_fr.rb, line 30 def country_code "#{fetch_sample(['+', '00'])}#{COUNTRY_CODE}" end
Source
# File lib/ffaker/phone_number_fr.rb, line 17 def home_work_phone_number number HOME_WORK_PHONE_PREFIX end
Source
# File lib/ffaker/phone_number_fr.rb, line 38 def international_home_work_phone_number number HOME_WORK_PHONE_PREFIX, country_code end
Source
# File lib/ffaker/phone_number_fr.rb, line 34 def international_mobile_phone_number number MOBILE_PHONE_PREFIX, country_code end
Source
# File lib/ffaker/phone_number_fr.rb, line 42 def international_phone_number rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number end
Source
# File lib/ffaker/phone_number_fr.rb, line 21 def mobile_phone_number number MOBILE_PHONE_PREFIX end
Source
# File lib/ffaker/phone_number_fr.rb, line 26 def phone_number rand(0..1).zero? ? home_work_phone_number : mobile_phone_number end
generates mobile or home/work number
Private Instance Methods
Source
# File lib/ffaker/phone_number_fr.rb, line 48 def number(prefixes, country_prefix = '') space = random_space prefix = fetch_sample(prefixes) prefix = prefix[1] unless country_prefix == '' FFaker.numerify [ country_prefix, space, prefix, fetch_sample(PHONE_NUMBER) ].join.strip end
Source
# File lib/ffaker/phone_number_fr.rb, line 61 def random_space rand(0..1).zero? ? '' : ' ' end