Module: FFaker::PhoneNumberFR

Extended by:
ModuleUtils, PhoneNumberFR
Included in:
PhoneNumberFR
Defined in:
lib/ffaker/phone_number_fr.rb

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

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#home_work_phone_numberObject


20
21
22
# File 'lib/ffaker/phone_number_fr.rb', line 20

def home_work_phone_number
  FFaker.numerify "#{COUNTRY_PREFIX.sample}#{AREA_PREFIX.sample}#{PHONE_NUMBER.sample}"
end

#mobile_phone_numberObject


24
25
26
# File 'lib/ffaker/phone_number_fr.rb', line 24

def mobile_phone_number
  FFaker.numerify "#{COUNTRY_PREFIX.sample}#{MOBILE_PREFIX.sample}#{PHONE_NUMBER.sample}"
end

#phone_numberObject


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