Class: Faker::Name
- Inherits:
-
Base
show all
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/faker/name.rb
Constant Summary
Constants inherited
from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary
collapse
Methods inherited from Base
bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.female_first_name ⇒ Object
28
29
30
|
# File 'lib/faker/name.rb', line 28
def female_first_name
fetch('name.female_first_name')
end
|
.first_name ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/faker/name.rb', line 16
def first_name
if parse('name.first_name').empty?
fetch('name.first_name')
else
parse('name.first_name')
end
end
|
.initials(character_count = 3) ⇒ Object
48
49
50
|
# File 'lib/faker/name.rb', line 48
def initials(character_count = 3)
(0...character_count).map { rand(65..90).chr }.join
end
|
.job_titles ⇒ Object
52
53
54
|
# File 'lib/faker/name.rb', line 52
def job_titles
fetch_all('job.position')
end
|
.last_name ⇒ Object
32
33
34
|
# File 'lib/faker/name.rb', line 32
def last_name
parse('name.last_name')
end
|
.male_first_name ⇒ Object
24
25
26
|
# File 'lib/faker/name.rb', line 24
def male_first_name
fetch('name.male_first_name')
end
|
.name ⇒ Object
8
9
10
|
# File 'lib/faker/name.rb', line 8
def name
parse('name.name')
end
|
.name_with_middle ⇒ Object
12
13
14
|
# File 'lib/faker/name.rb', line 12
def name_with_middle
parse('name.name_with_middle')
end
|
.prefix ⇒ Object
36
37
38
|
# File 'lib/faker/name.rb', line 36
def prefix
fetch('name.prefix')
end
|
.suffix ⇒ Object
40
41
42
|
# File 'lib/faker/name.rb', line 40
def suffix
fetch('name.suffix')
end
|
.title ⇒ Object
44
45
46
|
# File 'lib/faker/name.rb', line 44
def title
Faker::Job.title
end
|