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
Source
# File lib/ffaker/phone_number_au.rb, line 38 def home_work_phone_number FFaker.numerify("(#{home_work_phone_prefix}) #### ####") end
Generates a general phone number
(0x) xxxx xxxx
Source
# File lib/ffaker/phone_number_au.rb, line 27 def home_work_phone_prefix fetch_sample(HOME_WORK_OPERATORS_PREFIX) end
Return a prefix in HOME_WORK_OPERATORS_PREFIX
@see FFaker::PhoneNumberAU::HOME_WORK_OPERATORS_PREFIX
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
Source
# File lib/ffaker/phone_number_au.rb, line 61 def international_mobile_phone_number FFaker.numerify("#{country_code} #{mobile_phone_prefix[1]} #### ####") end
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
Source
# File lib/ffaker/phone_number_au.rb, line 45 def mobile_phone_number FFaker.numerify("#{mobile_phone_prefix}## ### ###") end
Generates a mobile phone number 04xx xxx xxx
Source
# File lib/ffaker/phone_number_au.rb, line 20 def mobile_phone_prefix fetch_sample(MOBILE_OPERATORS_PREFIX) end
Return a prefix in MOBILE_OPERATORS_PREFIX
@see FFaker::PhoneNumberAU::MOBILE_OPERATORS_PREFIX
Source
# 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
generates mobile or home/work number
Source
# File lib/ffaker/phone_number_au.rb, line 31 def phone_prefix fetch_sample(OPERATORS_PREFIX) end