Module: Faker::NameDE

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

Constant Summary collapse

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

Constants included from Name

Faker::Name::SUFFIXES

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from Name

#suffix

Instance Method Details

#first_nameObject



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

def first_name
  FIRST_NAMES.rand
end

#last_nameObject



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

def last_name
  LAST_NAMES.rand
end

#nameObject



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

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

#prefixObject



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

def prefix
  PREFIXES.rand
end