Module: FFaker::NameGR
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#female_first_name ⇒ Object
51
52
53
|
# File 'lib/ffaker/name_gr.rb', line 51
def female_first_name
fetch_sample(FEMALE_FIRST_NAMES)
end
|
#female_full_name ⇒ Object
39
40
41
|
# File 'lib/ffaker/name_gr.rb', line 39
def female_full_name
"#{female_first_name} #{female_last_name}"
end
|
#female_last_name ⇒ Object
55
56
57
|
# File 'lib/ffaker/name_gr.rb', line 55
def female_last_name
fetch_sample(FEMALE_LAST_NAMES)
end
|
#first_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
43
44
45
|
# File 'lib/ffaker/name_gr.rb', line 43
def male_first_name
fetch_sample(MALE_FIRST_NAMES)
end
|
#male_full_name ⇒ Object
35
36
37
|
# File 'lib/ffaker/name_gr.rb', line 35
def male_full_name
"#{male_first_name} #{male_last_name}"
end
|
#male_last_name ⇒ Object
47
48
49
|
# File 'lib/ffaker/name_gr.rb', line 47
def male_last_name
fetch_sample(MALE_LAST_NAMES)
end
|