Class: Faker::Name

Inherits:
Base
  • Object
show all
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, sample, shuffle, translate, unique, with_locale

Class Method Details

.first_nameObject


15
16
17
# File 'lib/faker/name.rb', line 15

def first_name
  fetch('name.first_name')
end

.initials(character_count = 3) ⇒ Object


37
38
39
# File 'lib/faker/name.rb', line 37

def initials(character_count=3)
  (0...character_count).map { (65 + rand(26)).chr }.join
end

.job_titlesObject


41
42
43
# File 'lib/faker/name.rb', line 41

def job_titles
  fetch_all('name.title.job')
end

.last_nameObject


19
20
21
# File 'lib/faker/name.rb', line 19

def last_name
  fetch('name.last_name')
end

.nameObject


7
8
9
# File 'lib/faker/name.rb', line 7

def name
  parse('name.name')
end

.name_with_middleObject


11
12
13
# File 'lib/faker/name.rb', line 11

def name_with_middle
  parse('name.name_with_middle')
end

.prefixObject


23
24
25
# File 'lib/faker/name.rb', line 23

def prefix
  fetch('name.prefix')
end

.suffixObject


27
28
29
# File 'lib/faker/name.rb', line 27

def suffix
  fetch('name.suffix')
end

.titleObject

Generate a buzzword-laden job title Wordlist from www.bullshitjob.com/title/


33
34
35
# File 'lib/faker/name.rb', line 33

def title
  "#{fetch('name.title.descriptor')} #{fetch('name.title.level')} #{fetch('name.title.job')}"
end