Module: FFaker::AddressUS

Extended by:
AddressUS, ModuleUtils
Includes:
Address
Included in:
AddressUS
Defined in:
lib/ffaker/address_us.rb

Constant Summary collapse

ZIP_FORMATS =
['#####', '#####-####']
CONTINENTAL_STATE =
(STATE - %w(Hawaii Alaska))
CONTINENTAL_STATE_ABBR =
(STATE_ABBR - %w(HI AK))

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

Methods included from Address

#building_number, #city, #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

#continental_stateObject



32
33
34
# File 'lib/ffaker/address_us.rb', line 32

def continental_state
  CONTINENTAL_STATE.sample
end

#continental_state_abbrObject



36
37
38
# File 'lib/ffaker/address_us.rb', line 36

def continental_state_abbr
  CONTINENTAL_STATE_ABBR.sample
end

#stateObject



20
21
22
# File 'lib/ffaker/address_us.rb', line 20

def state
  STATE.sample
end

#state_abbrObject



24
25
26
# File 'lib/ffaker/address_us.rb', line 24

def state_abbr
  STATE_ABBR.sample
end

#state_and_territories_abbrObject



28
29
30
# File 'lib/ffaker/address_us.rb', line 28

def state_and_territories_abbr
  STATE_AND_TERRITORIES_ABBR.sample
end

#zip_codeObject



16
17
18
# File 'lib/ffaker/address_us.rb', line 16

def zip_code
  FFaker.numerify ZIP_FORMATS.sample
end