module Faker::AddressAU

Author wiseleyb<wiseleyb@gmail.com>

Constants

POSTCODE
STATE

based on areas labeled state (+act) here: en.wikipedia.org/wiki/States_and_territories_of_Australia

STATE_ABBR
SUBURB

based on en.wikipedia.org/wiki/List_of_cities_in_Australia

Public Instance Methods

full_address(st_abbr = nil) click to toggle source
# File lib/ffakerer/address_au.rb, line 32
def full_address(st_abbr = nil)
  st_abbr ||= state_abbr
  "#{Faker::Address.street_address}, #{suburb(st_abbr)} #{st_abbr} #{postcode}"
end
postcode(st_abbr = nil) click to toggle source
# File lib/ffakerer/address_au.rb, line 13
def postcode(st_abbr = nil)
  st_abbr ||= state_abbr
  POSTCODE[st_abbr][rand(POSTCODE[st_abbr].size)]
end
state() click to toggle source
# File lib/ffakerer/address_au.rb, line 18
def state
  STATE.rand
end
state_abbr() click to toggle source
# File lib/ffakerer/address_au.rb, line 22
def state_abbr
  STATE_ABBR.rand
end
suburb(st_abbr = nil, p_code = nil) click to toggle source
# File lib/ffakerer/address_au.rb, line 26
def suburb(st_abbr = nil, p_code = nil)
  st_abbr ||= state_abbr
  p_code  ||= postcode(st_abbr)
  SUBURB[st_abbr][p_code]
end