Sha256: c9939760c28cfd87a2c562793bc6f3dca7bb6309f0b098004b36c6dfb556d466

Contents?: true

Size: 487 Bytes

Versions: 5

Compression:

Stored size: 487 Bytes

Contents

# encoding: utf-8

require 'ffaker/name'

module Faker
  module NameDE
    include Faker::Name

    extend ModuleUtils
    extend self

    PREFIXES = %w(Herr Frau Dr. Prof.)

    def name
      case rand(10)
      when 0 then "#{prefix} #{first_name} #{last_name}"
      else 	  "#{first_name} #{last_name}"
      end
    end

    def first_name
      FIRST_NAMES.sample
    end

    def last_name
      LAST_NAMES.sample
    end

    def prefix
      PREFIXES.sample
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_de.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_de.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_de.rb
ffaker-1.32.1 lib/ffaker/name_de.rb
ffaker-1.32.0 lib/ffaker/name_de.rb