Sha256: d8eb54f7ed1cbf103e7fcb2587981cd99196a44acca0cfbfb041f764bb341aa0

Contents?: true

Size: 623 Bytes

Versions: 3

Compression:

Stored size: 623 Bytes

Contents

# encoding: utf-8

require 'ffaker/address'

module FFaker
  module AddressDE
    include FFaker::Address

    extend ModuleUtils
    extend self

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

    def state
      STATE.sample
    end

    def city
      CITY.sample
    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffaker-2.2.0 lib/ffaker/address_de.rb
ffaker-2.1.0 lib/ffaker/address_de.rb
ffaker-2.0.0 lib/ffaker/address_de.rb