Sha256: fbe75ce46ee5c78698dc66456ce709600425f9f7d0bd9ec1ce57b55b96e834df

Contents?: true

Size: 656 Bytes

Versions: 6

Compression:

Stored size: 656 Bytes

Contents

# encoding: utf-8

require 'ffaker/address'

module Faker
  module AddressDE
    include Faker::Address

    extend ModuleUtils
    extend self

    def zip_code
      Faker.numerify ZIP_FORMATS.rand
    end

    def state
      STATE.rand
    end

    def city
      CITY.rand
    end

    def street_name
      case rand(2)
      when 0 then "#{NameDE.last_name}"
      when 1 then "#{NameDE.first_name}"
      end << case rand(20)
      when 0 then "weg"
      when 1 then "gasse"
      when 3 then "hain"
      else "str."
      end
    end

    def street_address
      "#{street_name} #{1+rand(192)}"
    end

    ZIP_FORMATS = k ['#####']
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffaker-1.30.0 lib/ffaker/address_de.rb
ffaker-1.25.0 lib/ffaker/address_de.rb
ffaker-1.24.0 lib/ffaker/address_de.rb
ffaker-1.23.0 lib/ffaker/address_de.rb
ffaker-1.22.1 lib/ffaker/address_de.rb
ffaker-1.22.0 lib/ffaker/address_de.rb