Module: Faker::AddressSE

Extended by:
AddressSE, ModuleUtils
Includes:
Address
Included in:
AddressSE
Defined in:
lib/ffakerer/address_se.rb

Overview

List of countries from sv.wikipedia.org/wiki/V%C3%A4rldens_l%C3%A4nder#Lista_.C3.B6ver_l.C3.A4nder The streetnames are all the roads in Stockholm that contains “väg” or “gata” List of cities are from sv.wikipedia.org/wiki/Sveriges_kommuner

Constant Summary collapse

ZIP_FORMATS =
k ['#####', '## ###']
STREET_NBR_FORMATS =
k ['##', '#', '#a', '#b', '###']

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



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

def city
  CITY.rand
end

#full_addressObject



36
37
38
# File 'lib/ffakerer/address_se.rb', line 36

def full_address
  "#{street_address}, #{zip_code} #{city}, SVERIGE"
end

#random_countryObject



40
41
42
# File 'lib/ffakerer/address_se.rb', line 40

def random_country
  COUNTRIES.rand
end

#street_addressObject



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

def street_address
  "#{street_name} #{street_nbr}"
end

#street_nameObject



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

def street_name
  STREET.rand
end

#street_nbrObject



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

def street_nbr
  Faker.numerify STREET_NBR_FORMATS.rand
end

#zip_codeObject



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

def zip_code
  Faker.numerify ZIP_FORMATS.rand
end