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, luhn_check, 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, #pronouns, #suffix

Instance Method Details

#first_nameObject



19
20
21
# File 'lib/ffaker/name_de.rb', line 19

def first_name
  fetch_sample(FIRST_NAMES)
end

#last_nameObject



23
24
25
# File 'lib/ffaker/name_de.rb', line 23

def last_name
  fetch_sample(LAST_NAMES)
end

#nameObject



12
13
14
15
16
17
# File 'lib/ffaker/name_de.rb', line 12

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

#prefixObject



27
28
29
# File 'lib/ffaker/name_de.rb', line 27

def prefix
  fetch_sample(PREFIXES)
end