Module: Faker::AddressUS
Constant Summary
collapse
- ZIP_FORMATS =
['#####', '#####-####']
- CONTINENTAL_STATE =
(STATE - ['Hawaii', 'Alaska'])
- CONTINENTAL_STATE_ABBR =
(STATE_ABBR - ['HI', 'AK'])
Constants included
from Address
Faker::Address::CITY_PREFIXES, Faker::Address::COMPASS_DIRECTIONS, Faker::Address::SEC_ADDR
Instance Method Summary
collapse
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, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr
Instance Method Details
#continental_state ⇒ Object
32
33
34
|
# File 'lib/ffaker/address_us.rb', line 32
def continental_state
CONTINENTAL_STATE.sample
end
|
#continental_state_abbr ⇒ Object
36
37
38
|
# File 'lib/ffaker/address_us.rb', line 36
def continental_state_abbr
CONTINENTAL_STATE_ABBR.sample
end
|
#state ⇒ Object
20
21
22
|
# File 'lib/ffaker/address_us.rb', line 20
def state
STATE.sample
end
|
#state_abbr ⇒ Object
24
25
26
|
# File 'lib/ffaker/address_us.rb', line 24
def state_abbr
STATE_ABBR.sample
end
|
#state_and_territories_abbr ⇒ Object
28
29
30
|
# File 'lib/ffaker/address_us.rb', line 28
def state_and_territories_abbr
STATE_AND_TERRITORIES_ABBR.sample
end
|
#zip_code ⇒ Object
16
17
18
|
# File 'lib/ffaker/address_us.rb', line 16
def zip_code
Faker.numerify ZIP_FORMATS.sample
end
|