Module: FFaker::NameUA

Extended by:
ModuleUtils, NameUA
Included in:
NameUA
Defined in:
lib/ffaker/name_ua.rb

Constant Summary collapse

FIRST_NAMES =
FIRST_NAMES_MALE + FIRST_NAMES_FEMALE
LAST_NAMES =
LAST_NAMES_MALE + LAST_NAMES_FEMALE
MIDDLE_NAMES =
MIDDLE_NAMES_MALE + MIDDLE_NAMES_FEMALE

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#first_nameObject


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

def first_name
  FIRST_NAMES.sample
end

#first_name_femaleObject


14
15
16
# File 'lib/ffaker/name_ua.rb', line 14

def first_name_female
  FIRST_NAMES_FEMALE.sample
end

#first_name_maleObject


18
19
20
# File 'lib/ffaker/name_ua.rb', line 18

def first_name_male
  FIRST_NAMES_MALE.sample
end

#last_nameObject


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

def last_name
  LAST_NAMES.sample
end

#last_name_femaleObject


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

def last_name_female
  LAST_NAMES_FEMALE.sample
end

#last_name_maleObject


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

def last_name_male
  LAST_NAMES_MALE.sample
end

#middle_name_femaleObject


22
23
24
# File 'lib/ffaker/name_ua.rb', line 22

def middle_name_female
  MIDDLE_NAMES_FEMALE.sample
end

#middle_name_maleObject


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

def middle_name_male
  MIDDLE_NAMES_MALE.sample
end

#nameObject


46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/ffaker/name_ua.rb', line 46

def name
  case rand(8)
  when 0 then first_name_male
  when 1 then first_name_female
  when 2 then "#{first_name_male} #{middle_name_male}"
  when 3 then "#{first_name_female} #{middle_name_male}"
  when 4 then "#{last_name_male} #{first_name_male}"
  when 5 then "#{last_name_female} #{first_name_female}"
  when 6 then "#{last_name_male} #{first_name_male} #{middle_name_male}"
  when 7 then "#{last_name_female} #{first_name_female} #{middle_name_female}"
  end
end