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.].freeze

Constants included from Name

FFaker::Name::FEMALE_PREFIXES, FFaker::Name::FIRST_NAMES, FFaker::Name::MALE_PREFIXES, FFaker::Name::OTHER_PREFIXES, FFaker::Name::SUFFIXES

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Methods included from Name

#female_name_with_prefix, #female_name_with_prefix_suffix, #female_name_with_suffix, #female_prefix, #first_name_female, #first_name_male, #html_safe_last_name, #html_safe_name, #male_name_with_prefix, #male_name_with_prefix_suffix, #male_name_with_suffix, #male_prefix, #name_with_prefix, #name_with_prefix_suffix, #name_with_suffix, #other_prefix, #suffix

Instance Method Details

#first_nameObject


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

def first_name
  fetch_sample(FIRST_NAMES)
end

#last_nameObject


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

def last_name
  fetch_sample(LAST_NAMES)
end

#nameObject


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

def name
  case rand(0..9)
  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
  fetch_sample(PREFIXES)
end