Sha256: 532a1eba0877cfcd7a3029e60308c2c8467b15138f7d7df7273f25ba51c0e1fc

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module FFakerTW
  module AddressNL
    include FFakerTW::Address

    extend ModuleUtils
    extend self

    def postal_code
      FFakerTW::String.from_regexp(/[1-9]\d{3} [A-RT-Z][A-Z]/)
    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(0..19)
      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

1 entries across 1 versions & 1 rubygems

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