Sha256: 1dcbf3c8ab425a52ac3a15cec860264df63b51d72b22ff6fbd58bca12dace21d

Contents?: true

Size: 1011 Bytes

Versions: 10

Compression:

Stored size: 1011 Bytes

Contents

# encoding: utf-8

require 'ffaker/address'

module FFaker
  # List of countries from http://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 http://sv.wikipedia.org/wiki/Sveriges_kommuner
  module AddressSE
    include FFaker::Address

    extend ModuleUtils
    extend self

    ZIP_FORMATS = ['#####', '## ###'].freeze
    STREET_NBR_FORMATS = ['##', '#', '#a', '#b', '###'].freeze

    def zip_code
      FFaker.numerify(fetch_sample(ZIP_FORMATS))
    end

    def city
      fetch_sample(CITY)
    end

    def street_name
      fetch_sample(STREET)
    end

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

    def street_nbr
      FFaker.numerify(fetch_sample(STREET_NBR_FORMATS))
    end

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

    def random_country
      fetch_sample(COUNTRIES)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ffaker-2.11.0 lib/ffaker/address_se.rb
ffaker-2.10.0 lib/ffaker/address_se.rb
ffaker-2.9.0 lib/ffaker/address_se.rb
ffaker-2.8.1 lib/ffaker/address_se.rb
ffaker-2.8.0 lib/ffaker/address_se.rb
ffaker-2.7.0 lib/ffaker/address_se.rb
ffaker-2.6.0 lib/ffaker/address_se.rb
ffaker-2.5.0 lib/ffaker/address_se.rb
ffaker-2.4.0 lib/ffaker/address_se.rb
ffaker-2.3.0 lib/ffaker/address_se.rb