Module: FFaker::AddressUS
Constant Summary
collapse
- ZIP_FORMATS =
['#####', '#####-####'].freeze
- 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
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
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_state ⇒ Object
34
35
36
|
# File 'lib/ffaker/address_us.rb', line 34
def continental_state
fetch_sample(CONTINENTAL_STATE)
end
|
#continental_state_abbr ⇒ Object
38
39
40
|
# File 'lib/ffaker/address_us.rb', line 38
def continental_state_abbr
fetch_sample(CONTINENTAL_STATE_ABBR)
end
|
#state ⇒ Object
18
19
20
|
# File 'lib/ffaker/address_us.rb', line 18
def state
fetch_sample(STATE)
end
|
#state_abbr(st_name = nil) ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/ffaker/address_us.rb', line 22
def state_abbr(st_name = nil)
return find_abbr(state) unless st_name
st_name = capitalize_all_words(st_name)
check_state_existence(st_name)
find_abbr(st_name)
end
|
#state_and_territories_abbr ⇒ Object
30
31
32
|
# File 'lib/ffaker/address_us.rb', line 30
def state_and_territories_abbr
fetch_sample(STATE_AND_TERRITORIES_ABBR)
end
|