Module: FFaker::NameGR

Extended by:
ModuleUtils, NameGR
Included in:
NameGR
Defined in:
lib/ffaker/name_gr.rb

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_first_nameObject



51
52
53
# File 'lib/ffaker/name_gr.rb', line 51

def female_first_name
  fetch_sample(FEMALE_FIRST_NAMES)
end

#female_full_nameObject



39
40
41
# File 'lib/ffaker/name_gr.rb', line 39

def female_full_name
  "#{female_first_name} #{female_last_name}"
end

#female_last_nameObject



55
56
57
# File 'lib/ffaker/name_gr.rb', line 55

def female_last_name
  fetch_sample(FEMALE_LAST_NAMES)
end

#first_nameObject

Random first name (male or female)



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

def first_name
  case rand(0..1)
  when 0 then male_first_name
  when 1 then female_first_name
  end
end

#full_name(gender = :any) ⇒ Object Also known as: name

Random full name (male or female). Arguments :male, :female, :any



9
10
11
12
13
14
15
16
# File 'lib/ffaker/name_gr.rb', line 9

def full_name(gender = :any)
  case gender
  when :any then rand(0..1).zero? ? male_full_name : female_full_name
  when :male then male_full_name
  when :female then female_full_name
  else raise ArgumentError, 'Invalid gender, must be one of :any, :male, :female'
  end
end

#last_nameObject

Random last name (male or female)



20
21
22
23
24
25
# File 'lib/ffaker/name_gr.rb', line 20

def last_name
  case rand(0..1)
  when 0 then male_last_name
  when 1 then female_last_name
  end
end

#male_first_nameObject



43
44
45
# File 'lib/ffaker/name_gr.rb', line 43

def male_first_name
  fetch_sample(MALE_FIRST_NAMES)
end

#male_full_nameObject



35
36
37
# File 'lib/ffaker/name_gr.rb', line 35

def male_full_name
  "#{male_first_name} #{male_last_name}"
end

#male_last_nameObject



47
48
49
# File 'lib/ffaker/name_gr.rb', line 47

def male_last_name
  fetch_sample(MALE_LAST_NAMES)
end