Module: FFaker::AddressID

Extended by:
AddressID, ModuleUtils
Includes:
Address
Included in:
AddressID
Defined in:
lib/ffaker/address_id.rb

Constant Summary collapse

STREET_PREFIX =
%w[Jl Jln].freeze

Constants included from Address

FFaker::Address::CITY_PREFIXES, FFaker::Address::COMPASS_DIRECTIONS, FFaker::Address::SEC_ADDR

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Methods included from Address

#building_number, #city_prefix, #city_suffix, #country, #country_code, #neighborhood, #secondary_address, #street_address, #street_name, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr

Instance Method Details

#cityObject


27
28
29
# File 'lib/ffaker/address_id.rb', line 27

def city
  fetch_sample(CITY)
end

#stateObject


19
20
21
# File 'lib/ffaker/address_id.rb', line 19

def state
  fetch_sample(STATE)
end

#state_abbrObject


23
24
25
# File 'lib/ffaker/address_id.rb', line 23

def state_abbr
  fetch_sample(STATE_ABBR)
end

#streetObject


35
36
37
# File 'lib/ffaker/address_id.rb', line 35

def street
  "#{street_prefix}. #{fetch_sample(COMMON_STREET_NAMES)}, No. #{rand(1..100)}"
end

#street_prefixObject


31
32
33
# File 'lib/ffaker/address_id.rb', line 31

def street_prefix
  fetch_sample(STREET_PREFIX)
end

#zip_codeObject


15
16
17
# File 'lib/ffaker/address_id.rb', line 15

def zip_code
  FFaker.numerify '#####'
end