module FFaker::PhoneNumberAU
Based on information from en.wikipedia.org/wiki/Telephone_numbers_in_Australia
Constants
- HOME_WORK_OPERATORS_PREFIX
Home or Work Operator prefixes
- MOBILE_OPERATORS_PREFIX
Mobile prefixes
- OPERATORS_PREFIX
Public Instance Methods
country_code()
click to toggle source
# File lib/ffaker/phone_number_au.rb, line 57 def country_code '+61' end
home_work_phone_number()
click to toggle source
Generates a general phone number
(0x) xxxx xxxx
# File lib/ffaker/phone_number_au.rb, line 38 def home_work_phone_number FFaker.numerify("(#{home_work_phone_prefix}) #### ####") end
home_work_phone_prefix()
click to toggle source
Return a prefix in HOME_WORK_OPERATORS_PREFIX
@see FFaker::PhoneNumberAU::HOME_WORK_OPERATORS_PREFIX
# File lib/ffaker/phone_number_au.rb, line 27 def home_work_phone_prefix fetch_sample(HOME_WORK_OPERATORS_PREFIX) end
international_home_work_phone_number()
click to toggle source
# File lib/ffaker/phone_number_au.rb, line 65 def international_home_work_phone_number FFaker.numerify("#{country_code} #{home_work_phone_prefix[1]} #### ####") end
international_mobile_phone_number()
click to toggle source
# File lib/ffaker/phone_number_au.rb, line 61 def international_mobile_phone_number FFaker.numerify("#{country_code} #{mobile_phone_prefix[1]} #### ####") end
international_phone_number()
click to toggle source
# File lib/ffaker/phone_number_au.rb, line 69 def international_phone_number case rand(0..1) when 0 then international_mobile_phone_number when 1 then international_home_work_phone_number end end
mobile_phone_number()
click to toggle source
Generates a mobile phone number 04xx xxx xxx
# File lib/ffaker/phone_number_au.rb, line 45 def mobile_phone_number FFaker.numerify("#{mobile_phone_prefix}## ### ###") end
mobile_phone_prefix()
click to toggle source
Return a prefix in MOBILE_OPERATORS_PREFIX
@see FFaker::PhoneNumberAU::MOBILE_OPERATORS_PREFIX
# File lib/ffaker/phone_number_au.rb, line 20 def mobile_phone_prefix fetch_sample(MOBILE_OPERATORS_PREFIX) end
phone_number()
click to toggle source
generates mobile or home/work number
# File lib/ffaker/phone_number_au.rb, line 50 def phone_number case rand(0..1) when 0 then home_work_phone_number when 1 then mobile_phone_number end end
phone_prefix()
click to toggle source
# File lib/ffaker/phone_number_au.rb, line 31 def phone_prefix fetch_sample(OPERATORS_PREFIX) end