Class: Faker::Name
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.female_first_name ⇒ String
(also: first_name_women, feminine_name)
Produces a random female first name.
-
.first_name ⇒ String
Produces a random first name.
-
.initials(number: 3) ⇒ String
Produces random initials.
-
.last_name ⇒ String
(also: middle_name)
Produces a random last name.
-
.male_first_name ⇒ String
(also: first_name_men, masculine_name)
Produces a random male first name.
-
.name ⇒ String
Produces a random name.
-
.name_with_middle ⇒ String
Produces a random name with middle name.
-
.neutral_first_name ⇒ String
(also: first_name_neutral, gender_neutral_first_name)
Produces a random gender neutral first name.
-
.prefix ⇒ String
Produces a random name prefix.
-
.suffix ⇒ String
Produces a random name suffix.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, 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_name ⇒ String Also known as: first_name_women, feminine_name
Produces a random female first name.
75 76 77 |
# File 'lib/faker/default/name.rb', line 75 def female_first_name fetch('name.female_first_name') end |
.first_name ⇒ String
Produces a random first name.
43 44 45 46 47 48 49 |
# File 'lib/faker/default/name.rb', line 43 def first_name if parse('name.first_name').empty? fetch('name.first_name') else parse('name.first_name') end end |
.initials(number: 3) ⇒ String
Produces random initials.
147 148 149 |
# File 'lib/faker/default/name.rb', line 147 def initials(number: 3) (0...number).map { rand(65..90).chr }.join end |
.last_name ⇒ String Also known as: middle_name
Produces a random last name.
105 106 107 |
# File 'lib/faker/default/name.rb', line 105 def last_name parse('name.last_name') end |
.male_first_name ⇒ String Also known as: first_name_men, masculine_name
Produces a random male first name.
60 61 62 |
# File 'lib/faker/default/name.rb', line 60 def male_first_name fetch('name.male_first_name') end |
.name ⇒ String
Produces a random name.
17 18 19 |
# File 'lib/faker/default/name.rb', line 17 def name parse('name.name') end |
.name_with_middle ⇒ String
Produces a random name with middle name.
30 31 32 |
# File 'lib/faker/default/name.rb', line 30 def name_with_middle parse('name.name_with_middle') end |
.neutral_first_name ⇒ String Also known as: first_name_neutral, gender_neutral_first_name
Produces a random gender neutral first name.
90 91 92 |
# File 'lib/faker/default/name.rb', line 90 def neutral_first_name fetch('name.neutral_first_name') end |
.prefix ⇒ String
Produces a random name prefix.
119 120 121 |
# File 'lib/faker/default/name.rb', line 119 def prefix fetch('name.prefix') end |
.suffix ⇒ String
Produces a random name suffix.
132 133 134 |
# File 'lib/faker/default/name.rb', line 132 def suffix fetch('name.suffix') end |