Sha256: bb982914a58d15310fd1f18a181f766dd49e36493f7fd4963e80276ac2345588

Contents?: true

Size: 746 Bytes

Versions: 6

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

module FFaker
  module AddressDA
    include FFaker::Address

    extend ModuleUtils
    extend self

    REGION = %w[Hovedstaden Sjælland Syddanmark Midtjylland Nordjylland].freeze
    STATE = REGION

    def zip_code
      FFaker.numerify('####')
    end

    def post_nr
      zip_code
    end

    def state
      kommune
    end

    def kommune
      fetch_sample(KOMMUNE)
    end

    def region
      fetch_sample(REGION)
    end

    def city
      fetch_sample(CITY)
    end

    def street_name
      fetch_sample(STREET)
    end

    def street_address
      "#{street_name} #{rand(0..99)}"
    end

    def full_address
      "#{street_address} #{post_nr} #{city} #{region} DANMARK"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffaker-2.23.0 lib/ffaker/address_da.rb
ffaker-2.22.0 lib/ffaker/address_da.rb
ffaker-2.21.0 lib/ffaker/address_da.rb
ffaker-2.20.0 lib/ffaker/address_da.rb
ffaker-2.19.0 lib/ffaker/address_da.rb
ffaker-2.18.0 lib/ffaker/address_da.rb