Sha256: d0bb3af7786ecb952cfc18aed216f0302fd73a1b563fe395fa295bebeecb2432

Contents?: true

Size: 766 Bytes

Versions: 4

Compression:

Stored size: 766 Bytes

Contents

# encoding: utf-8

require 'ffaker/address'

module FFaker
  module AddressNL
    include FFaker::Address

    extend ModuleUtils
    extend self

    POSTAL_CODE_FORMAT = ['#### ??'].freeze

    def postal_code
      FFaker.bothify POSTAL_CODE_FORMAT
    end

    def zip_code
      postal_code
    end

    def street_name
      name = fetch_sample([true, false]) ? NameNL.last_name : NameNL.first_name
      name + random_type_of_street
    end

    def city
      fetch_sample(CITY)
    end

    def province
      fetch_sample(PROVINCE)
    end

    private

    def random_type_of_street
      case rand(20)
      when 0 then 'weg'
      when 1 then 'boulevard'
      when 3 then 'pad'
      when 4 then 'steeg'
      else 'straat'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffaker-2.6.0 lib/ffaker/address_nl.rb
ffaker-2.5.0 lib/ffaker/address_nl.rb
ffaker-2.4.0 lib/ffaker/address_nl.rb
ffaker-2.3.0 lib/ffaker/address_nl.rb