Module: FFaker::NameIN

Extended by:
ModuleUtils, NameIN
Included in:
NameIN
Defined in:
lib/ffaker/name_in.rb

Overview

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#first_name_femaleObject


12
13
14
# File 'lib/ffaker/name_in.rb', line 12

def first_name_female
  fetch_sample(FIRST_NAMES_FEMALE)
end

#first_name_maleObject


16
17
18
# File 'lib/ffaker/name_in.rb', line 16

def first_name_male
  fetch_sample(FIRST_NAMES_MALE)
end

#last_nameObject


20
21
22
# File 'lib/ffaker/name_in.rb', line 20

def last_name
  fetch_sample(LAST_NAMES)
end

#nameObject


32
33
34
35
36
37
# File 'lib/ffaker/name_in.rb', line 32

def name
  case rand(0..1)
  when 1 then name_male
  else name_female
  end
end

#name_femaleObject


28
29
30
# File 'lib/ffaker/name_in.rb', line 28

def name_female
  "#{first_name_female} #{last_name}"
end

#name_maleObject


24
25
26
# File 'lib/ffaker/name_in.rb', line 24

def name_male
  "#{first_name_male} #{last_name}"
end