Module: FFaker::AddressDA

Extended by:
AddressDA, ModuleUtils
Includes:
Address
Included in:
AddressDA
Defined in:
lib/ffaker/address_da.rb

Constant Summary collapse

REGION =
%w[Hovedstaden Sjælland Syddanmark Midtjylland Nordjylland].freeze
STATE =
REGION

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, 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


33
34
35
# File 'lib/ffaker/address_da.rb', line 33

def city
  fetch_sample(CITY)
end

#full_addressObject


45
46
47
# File 'lib/ffaker/address_da.rb', line 45

def full_address
  "#{street_address} #{post_nr} #{city} #{region} DANMARK"
end

#kommuneObject


25
26
27
# File 'lib/ffaker/address_da.rb', line 25

def kommune
  fetch_sample(KOMMUNE)
end

#post_nrObject


17
18
19
# File 'lib/ffaker/address_da.rb', line 17

def post_nr
  zip_code
end

#regionObject


29
30
31
# File 'lib/ffaker/address_da.rb', line 29

def region
  fetch_sample(REGION)
end

#stateObject


21
22
23
# File 'lib/ffaker/address_da.rb', line 21

def state
  kommune
end

#street_addressObject


41
42
43
# File 'lib/ffaker/address_da.rb', line 41

def street_address
  "#{street_name} #{rand(0..99)}"
end

#street_nameObject


37
38
39
# File 'lib/ffaker/address_da.rb', line 37

def street_name
  fetch_sample(STREET)
end

#zip_codeObject


13
14
15
# File 'lib/ffaker/address_da.rb', line 13

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