Module: FFaker::AddressDE

Extended by:
AddressDE, ModuleUtils
Includes:
Address
Included in:
AddressDE
Defined in:
lib/ffaker/address_de.rb

Constant Summary

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, luhn_check, 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_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr

Instance Method Details

#cityObject



18
19
20
# File 'lib/ffaker/address_de.rb', line 18

def city
  fetch_sample(CITY)
end

#stateObject



14
15
16
# File 'lib/ffaker/address_de.rb', line 14

def state
  fetch_sample(STATE)
end

#street_addressObject



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

def street_address
  "#{street_name} #{rand(1..192)}"
end

#street_nameObject



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

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_codeObject



10
11
12
# File 'lib/ffaker/address_de.rb', line 10

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