Sha256: dbae9cf508707dc9a8ad649211812d950d6bdf777c1107b95462effb525daca5

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

# encoding: utf-8

require 'ffakerer/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

2 entries across 2 versions & 1 rubygems

Version Path
ffakerer-1.0.2 lib/ffakerer/address_de.rb
ffakerer-1.0.1 lib/ffakerer/address_de.rb