Sha256: c06c570d398da86ea7c7475b410783ed391d5b6e2d6fd2316bba282d0e7a5612

Contents?: true

Size: 505 Bytes

Versions: 6

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

module FFaker
  module NameDE
    include FFaker::Name

    extend ModuleUtils
    extend self

    PREFIXES = %w[Herr Frau Dr. Prof.].freeze

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

    def first_name
      fetch_sample(FIRST_NAMES)
    end

    def last_name
      fetch_sample(LAST_NAMES)
    end

    def prefix
      fetch_sample(PREFIXES)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffaker-2.23.0 lib/ffaker/name_de.rb
ffaker-2.22.0 lib/ffaker/name_de.rb
ffaker-2.21.0 lib/ffaker/name_de.rb
ffaker-2.20.0 lib/ffaker/name_de.rb
ffaker-2.19.0 lib/ffaker/name_de.rb
ffaker-2.18.0 lib/ffaker/name_de.rb