Module: Faker::AddressDA

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

Constant Summary collapse

ZIP_FORMATS =
k ['####']
REGION =
k [
  'Hovedstaden', 'Sjælland', 'Syddanmark', 'Midtjylland', 'Nordjylland'
]
STATE =
REGION

Constants included from Address

Faker::Address::CITY_PREFIXES, Faker::Address::COMPASS_DIRECTIONS, Faker::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, #neighborhood, #secondary_address, #street_suffix, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr

Instance Method Details

#cityObject



32
33
34
# File 'lib/ffakerer/address_da.rb', line 32

def city
  CITY.rand
end

#full_addressObject



46
47
48
# File 'lib/ffakerer/address_da.rb', line 46

def full_address
  %Q{#{street_address} #{post_nr} #{city} #{region} DANMARK}
end

#kommuneObject



24
25
26
# File 'lib/ffakerer/address_da.rb', line 24

def kommune
  KOMMUNE.rand
end

#post_nrObject



16
17
18
# File 'lib/ffakerer/address_da.rb', line 16

def post_nr
  zip_code
end

#regionObject



28
29
30
# File 'lib/ffakerer/address_da.rb', line 28

def region
  REGION.rand
end

#stateObject



20
21
22
# File 'lib/ffakerer/address_da.rb', line 20

def state
  kommune
end

#street_addressObject



42
43
44
# File 'lib/ffakerer/address_da.rb', line 42

def street_address
  "#{Faker::AddressDA.street_address} #{rand(100)}"
end

#street_nameObject



38
39
40
# File 'lib/ffakerer/address_da.rb', line 38

def street_name
  STREET.rand
end

#zip_codeObject



12
13
14
# File 'lib/ffakerer/address_da.rb', line 12

def zip_code
  Faker.numerify ZIP_FORMATS.rand
end