Module: FFaker::AddressSE

Extended by:
AddressSE, ModuleUtils
Includes:
Address
Included in:
AddressSE
Defined in:
lib/ffaker/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 =
['#####', '## ###']
STREET_NBR_FORMATS =
['##', '#', '#a', '#b', '###']

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



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

def city
  CITY.sample
end

#full_addressObject



38
39
40
# File 'lib/ffaker/address_se.rb', line 38

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

#random_countryObject



42
43
44
# File 'lib/ffaker/address_se.rb', line 42

def random_country
  COUNTRIES.sample
end

#street_addressObject



30
31
32
# File 'lib/ffaker/address_se.rb', line 30

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

#street_nameObject



26
27
28
# File 'lib/ffaker/address_se.rb', line 26

def street_name
  STREET.sample
end

#street_nbrObject



34
35
36
# File 'lib/ffaker/address_se.rb', line 34

def street_nbr
  FFaker.numerify STREET_NBR_FORMATS.sample
end

#zip_codeObject



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

def zip_code
  FFaker.numerify ZIP_FORMATS.sample
end