module FFaker::AddressAU
Constants
- POSTCODE
- STATE
based on areas labeled state (+act) here: en.wikipedia.org/wiki/States_and_territories_of_Australia
- STATE_ABBR
- SUBURB
- TIME_ZONE
Public Instance Methods
full_address(st_abbr = nil)
click to toggle source
# File lib/ffaker/address_au.rb, line 109 def full_address(st_abbr = nil) st_abbr ||= state_abbr "#{FFaker::Address.street_address}, #{suburb(st_abbr)} #{st_abbr} #{postcode}" end
postcode(st_abbr = nil)
click to toggle source
# File lib/ffaker/address_au.rb, line 90 def postcode(st_abbr = nil) st_abbr ||= state_abbr POSTCODE[st_abbr][rand(0...POSTCODE[st_abbr].size)] end
state()
click to toggle source
# File lib/ffaker/address_au.rb, line 95 def state fetch_sample(STATE) end
state_abbr()
click to toggle source
# File lib/ffaker/address_au.rb, line 99 def state_abbr fetch_sample(STATE_ABBR) end
suburb(st_abbr = nil, p_code = nil)
click to toggle source
# File lib/ffaker/address_au.rb, line 103 def suburb(st_abbr = nil, p_code = nil) st_abbr ||= state_abbr p_code ||= postcode(st_abbr) SUBURB[st_abbr][p_code] end
time_zone(st_abbr = nil)
click to toggle source
# File lib/ffaker/address_au.rb, line 114 def time_zone(st_abbr = nil) return TIME_ZONE[st_abbr] if st_abbr TIME_ZONE.values.sample end