Module: FFaker::NameDE

Extended by:
ModuleUtils, NameDE
Includes:
Name
Included in:
NameDE
Defined in:
lib/ffaker/name_de.rb

Constant Summary collapse

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

Constants included from Name

FFaker::Name::SUFFIXES

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from Name

#suffix

Instance Method Details

#first_nameObject



21
22
23
# File 'lib/ffaker/name_de.rb', line 21

def first_name
  FIRST_NAMES.sample
end

#last_nameObject



25
26
27
# File 'lib/ffaker/name_de.rb', line 25

def last_name
  LAST_NAMES.sample
end

#nameObject



14
15
16
17
18
19
# File 'lib/ffaker/name_de.rb', line 14

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

#prefixObject



29
30
31
# File 'lib/ffaker/name_de.rb', line 29

def prefix
  PREFIXES.sample
end