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

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



35
36
37
# File 'lib/ffaker/address_da.rb', line 35

def city
  CITY.sample
end

#full_addressObject



47
48
49
# File 'lib/ffaker/address_da.rb', line 47

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

#kommuneObject



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

def kommune
  KOMMUNE.sample
end

#post_nrObject



19
20
21
# File 'lib/ffaker/address_da.rb', line 19

def post_nr
  zip_code
end

#regionObject



31
32
33
# File 'lib/ffaker/address_da.rb', line 31

def region
  REGION.sample
end

#stateObject



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

def state
  kommune
end

#street_addressObject



43
44
45
# File 'lib/ffaker/address_da.rb', line 43

def street_address
  "#{street_name} #{rand(100)}"
end

#street_nameObject



39
40
41
# File 'lib/ffaker/address_da.rb', line 39

def street_name
  STREET.sample
end

#zip_codeObject



15
16
17
# File 'lib/ffaker/address_da.rb', line 15

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