Module: FFaker::NameNL

Extended by:
ModuleUtils, NameNL
Includes:
Name
Included in:
NameNL
Defined in:
lib/ffaker/name_nl.rb

Constant Summary collapse

PREFIXES =
%w(Dr. Drs. Ir. Ing. 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
24
25
26
# File 'lib/ffaker/name_nl.rb', line 21

def first_name
  case rand(2)
  when 0 then first_name_female
  when 1 then first_name_male
  end
end

#first_name_femaleObject


28
29
30
31
32
33
# File 'lib/ffaker/name_nl.rb', line 28

def first_name_female
  case rand(8)
  when 0 then [FIRST_NAMES_FEMALE.sample, FIRST_NAMES_FEMALE.sample].join('-')
  else FIRST_NAMES_FEMALE.sample
  end
end

#first_name_maleObject


35
36
37
38
39
40
# File 'lib/ffaker/name_nl.rb', line 35

def first_name_male
  case rand(8)
  when 0 then [FIRST_NAMES_MALE.sample, FIRST_NAMES_MALE.sample].join('-')
  else FIRST_NAMES_MALE.sample
  end
end

#last_nameObject


42
43
44
# File 'lib/ffaker/name_nl.rb', line 42

def last_name
  LAST_NAMES.sample
end

#nameObject


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

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

#prefixObject


46
47
48
# File 'lib/ffaker/name_nl.rb', line 46

def prefix
  PREFIXES.sample
end