Sha256: 113b0df6326ca905552299461c85d93ca8d374b4b0ebba16aff56d61dd745ab4

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

# frozen_string_literal: true

module FFakerTW
  # 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 FFakerTW::Address

    extend ModuleUtils
    extend self

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

    def zip_code
      FFakerTW.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
      FFakerTW.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

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 lib/ffakerTW/address_se.rb