Module: FFaker::NameID

Extended by:
ModuleUtils, NameID
Included in:
NameID
Defined in:
lib/ffaker/name_id.rb

Constant Summary collapse

MALE_PREFIXES =
%w[Tn.].freeze
FEMALE_PREFIXES =
%w[Ny. Nn.].freeze
PREFIXES =
(MALE_PREFIXES + FEMALE_PREFIXES).freeze
FIRST_NAMES =
(FIRST_NAMES_FEMALE + FIRST_NAMES_MALE).freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#female_name_with_prefixObject



26
27
28
# File 'lib/ffaker/name_id.rb', line 26

def female_name_with_prefix
  "#{female_prefix} #{first_name_female} #{last_name}"
end

#female_prefixObject



54
55
56
# File 'lib/ffaker/name_id.rb', line 54

def female_prefix
  fetch_sample(FEMALE_PREFIXES)
end

#first_nameObject



34
35
36
# File 'lib/ffaker/name_id.rb', line 34

def first_name
  fetch_sample(FIRST_NAMES)
end

#first_name_femaleObject



38
39
40
# File 'lib/ffaker/name_id.rb', line 38

def first_name_female
  fetch_sample(FIRST_NAMES_FEMALE)
end

#first_name_maleObject



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

def first_name_male
  fetch_sample(FIRST_NAMES_MALE)
end

#last_nameObject



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

def last_name
  fetch_sample(LAST_NAMES)
end

#male_name_with_prefixObject



30
31
32
# File 'lib/ffaker/name_id.rb', line 30

def male_name_with_prefix
  "#{male_prefix} #{first_name_male} #{last_name}"
end

#male_prefixObject



58
59
60
# File 'lib/ffaker/name_id.rb', line 58

def male_prefix
  fetch_sample(MALE_PREFIXES)
end

#nameObject



13
14
15
# File 'lib/ffaker/name_id.rb', line 13

def name
  "#{first_name} #{last_name}"
end

#name_with_prefixObject



17
18
19
20
21
22
23
24
# File 'lib/ffaker/name_id.rb', line 17

def name_with_prefix
  fetch_sample(
    [
      female_name_with_prefix,
      male_name_with_prefix
    ]
  )
end

#prefixObject



50
51
52
# File 'lib/ffaker/name_id.rb', line 50

def prefix
  fetch_sample(PREFIXES)
end