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.].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, #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
22
23
24
# File 'lib/ffaker/name_nl.rb', line 19

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

#first_name_femaleObject



26
27
28
29
30
31
# File 'lib/ffaker/name_nl.rb', line 26

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

#first_name_maleObject



33
34
35
36
37
38
# File 'lib/ffaker/name_nl.rb', line 33

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

#last_nameObject



40
41
42
# File 'lib/ffaker/name_nl.rb', line 40

def last_name
  fetch_sample(LAST_NAMES)
end

#nameObject



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

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

#prefixObject



44
45
46
# File 'lib/ffaker/name_nl.rb', line 44

def prefix
  fetch_sample(PREFIXES)
end