Class: Faker::Name

Inherits:
Base
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/faker/default/name.rb

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.female_first_nameObject Also known as: first_name_women, feminine_name


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

def female_first_name
  fetch('name.female_first_name')
end

.first_nameObject


18
19
20
21
22
23
24
# File 'lib/faker/default/name.rb', line 18

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


51
52
53
# File 'lib/faker/default/name.rb', line 51

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

.last_nameObject Also known as: middle_name


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

def last_name
  parse('name.last_name')
end

.male_first_nameObject Also known as: first_name_men, masculine_name


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

def male_first_name
  fetch('name.male_first_name')
end

.nameObject


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

def name
  parse('name.name')
end

.name_with_middleObject


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

def name_with_middle
  parse('name.name_with_middle')
end

.prefixObject


43
44
45
# File 'lib/faker/default/name.rb', line 43

def prefix
  fetch('name.prefix')
end

.suffixObject


47
48
49
# File 'lib/faker/default/name.rb', line 47

def suffix
  fetch('name.suffix')
end