Module: FFaker::AddressDE
Constant Summary
Constants included
from Address
FFaker::Address::CITY_PREFIXES, FFaker::Address::COMPASS_DIRECTIONS, FFaker::Address::SEC_ADDR
Instance Method Summary
collapse
const_missing, k, underscore
#fetch_sample, #rand, #shuffle
Methods included from Address
#building_number, #city_prefix, #city_suffix, #country, #country_code, #neighborhood, #secondary_address, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr
Instance Method Details
#city ⇒ Object
20
21
22
|
# File 'lib/ffaker/address_de.rb', line 20
def city
fetch_sample(CITY)
end
|
#state ⇒ Object
16
17
18
|
# File 'lib/ffaker/address_de.rb', line 16
def state
fetch_sample(STATE)
end
|
#street_address ⇒ Object
29
30
31
|
# File 'lib/ffaker/address_de.rb', line 29
def street_address
"#{street_name} #{1 + rand(192)}"
end
|
#street_name ⇒ Object
24
25
26
27
|
# File 'lib/ffaker/address_de.rb', line 24
def street_name
name = fetch_sample([true, false]) ? NameDE.last_name.to_s : NameDE.first_name.to_s
name + random_type_of_street
end
|
#zip_code ⇒ Object
12
13
14
|
# File 'lib/ffaker/address_de.rb', line 12
def zip_code
FFaker.numerify '#####'
end
|