Module: FFaker::Name
Constant Summary
collapse
- MALE_PREFIXES =
%w[Mr.].freeze
- FEMALE_PREFIXES =
%w[Mrs. Miss.].freeze
- OTHER_PREFIXES =
%w[Ms. Dr.].freeze
- PREFIXES =
(MALE_PREFIXES + FEMALE_PREFIXES + OTHER_PREFIXES).freeze
- FIRST_NAMES =
(FIRST_NAMES_FEMALE + FIRST_NAMES_MALE).freeze
- SUFFIXES =
%w[Jr. Sr. I II III IV V MD DDS PhD DVM].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#female_name_with_prefix ⇒ Object
50
51
52
|
# File 'lib/ffaker/name.rb', line 50
def female_name_with_prefix
"#{female_prefix} #{first_name_female} #{last_name}"
end
|
#female_name_with_prefix_suffix ⇒ Object
66
67
68
|
# File 'lib/ffaker/name.rb', line 66
def female_name_with_prefix_suffix
"#{female_prefix} #{first_name_female} #{last_name} #{suffix}"
end
|
#female_name_with_suffix ⇒ Object
58
59
60
|
# File 'lib/ffaker/name.rb', line 58
def female_name_with_suffix
"#{first_name_female} #{last_name} #{suffix}"
end
|
#female_prefix ⇒ Object
101
102
103
|
# File 'lib/ffaker/name.rb', line 101
def female_prefix
fetch_sample(FEMALE_PREFIXES)
end
|
#first_name ⇒ Object
74
75
76
|
# File 'lib/ffaker/name.rb', line 74
def first_name
fetch_sample(FIRST_NAMES)
end
|
#first_name_female ⇒ Object
78
79
80
|
# File 'lib/ffaker/name.rb', line 78
def first_name_female
fetch_sample(FIRST_NAMES_FEMALE)
end
|
#first_name_male ⇒ Object
82
83
84
|
# File 'lib/ffaker/name.rb', line 82
def first_name_male
fetch_sample(FIRST_NAMES_MALE)
end
|
#html_safe_last_name ⇒ Object
90
91
92
93
94
95
|
# File 'lib/ffaker/name.rb', line 90
def html_safe_last_name
loop do
t = LAST_NAMES.sample
return t unless t.include? "'"
end
end
|
#html_safe_name ⇒ Object
19
20
21
|
# File 'lib/ffaker/name.rb', line 19
def html_safe_name
"#{first_name} #{html_safe_last_name}"
end
|
#last_name ⇒ Object
86
87
88
|
# File 'lib/ffaker/name.rb', line 86
def last_name
fetch_sample(LAST_NAMES)
end
|
#male_name_with_prefix ⇒ Object
54
55
56
|
# File 'lib/ffaker/name.rb', line 54
def male_name_with_prefix
"#{male_prefix} #{first_name_male} #{last_name}"
end
|
#male_name_with_prefix_suffix ⇒ Object
70
71
72
|
# File 'lib/ffaker/name.rb', line 70
def male_name_with_prefix_suffix
"#{male_prefix} #{first_name_male} #{last_name} #{suffix}"
end
|
#male_name_with_suffix ⇒ Object
62
63
64
|
# File 'lib/ffaker/name.rb', line 62
def male_name_with_suffix
"#{first_name_male} #{last_name} #{suffix}"
end
|
#male_prefix ⇒ Object
105
106
107
|
# File 'lib/ffaker/name.rb', line 105
def male_prefix
fetch_sample(MALE_PREFIXES)
end
|
#name ⇒ Object
15
16
17
|
# File 'lib/ffaker/name.rb', line 15
def name
"#{first_name} #{last_name}"
end
|
#name_with_prefix ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/ffaker/name.rb', line 23
def name_with_prefix
fetch_sample(
[
female_name_with_prefix,
male_name_with_prefix
]
)
end
|
#name_with_prefix_suffix ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/ffaker/name.rb', line 41
def name_with_prefix_suffix
fetch_sample(
[
female_name_with_prefix_suffix,
male_name_with_prefix_suffix
]
)
end
|
#name_with_suffix ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/ffaker/name.rb', line 32
def name_with_suffix
fetch_sample(
[
female_name_with_suffix,
male_name_with_suffix
]
)
end
|
#other_prefix ⇒ Object
109
110
111
|
# File 'lib/ffaker/name.rb', line 109
def other_prefix
fetch_sample(OTHER_PREFIXES)
end
|
#prefix ⇒ Object
97
98
99
|
# File 'lib/ffaker/name.rb', line 97
def prefix
fetch_sample(PREFIXES)
end
|
#pronouns ⇒ Object
117
118
119
|
# File 'lib/ffaker/name.rb', line 117
def pronouns
fetch_sample(PRONOUNS)
end
|
#suffix ⇒ Object
113
114
115
|
# File 'lib/ffaker/name.rb', line 113
def suffix
fetch_sample(SUFFIXES)
end
|