Module: FFaker::NameES
- Extended by:
- ModuleUtils
- Defined in:
- lib/ffaker/name_es.rb
Constant Summary
collapse
- MALE_PREFIXES =
%w[D. Dr.].freeze
- FEMALE_PREFIXES =
%w[D.ª Dra.].freeze
- PREFIXES =
(MALE_PREFIXES + FEMALE_PREFIXES).freeze
- FIRST_NAMES =
(FIRST_NAMES_FEMALE + FIRST_NAMES_MALE).freeze
Class Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Class Method Details
.female_name_with_prefix ⇒ Object
28
29
30
|
# File 'lib/ffaker/name_es.rb', line 28
def female_name_with_prefix
"#{female_prefix} #{first_name_female} #{last_name} #{last_name}"
end
|
.female_prefix ⇒ Object
56
57
58
|
# File 'lib/ffaker/name_es.rb', line 56
def female_prefix
fetch_sample(FEMALE_PREFIXES)
end
|
.first_name ⇒ Object
36
37
38
|
# File 'lib/ffaker/name_es.rb', line 36
def first_name
fetch_sample(FIRST_NAMES)
end
|
.first_name_female ⇒ Object
40
41
42
|
# File 'lib/ffaker/name_es.rb', line 40
def first_name_female
fetch_sample(FIRST_NAMES_FEMALE)
end
|
.first_name_male ⇒ Object
44
45
46
|
# File 'lib/ffaker/name_es.rb', line 44
def first_name_male
fetch_sample(FIRST_NAMES_MALE)
end
|
.last_name ⇒ Object
48
49
50
|
# File 'lib/ffaker/name_es.rb', line 48
def last_name
fetch_sample(LAST_NAMES)
end
|
.male_name_with_prefix ⇒ Object
32
33
34
|
# File 'lib/ffaker/name_es.rb', line 32
def male_name_with_prefix
"#{male_prefix} #{first_name_male} #{last_name} #{last_name}"
end
|
.male_prefix ⇒ Object
60
61
62
|
# File 'lib/ffaker/name_es.rb', line 60
def male_prefix
fetch_sample(MALE_PREFIXES)
end
|
.name ⇒ Object
In Spain we use two surnames: The father’s and the mother’s
15
16
17
|
# File 'lib/ffaker/name_es.rb', line 15
def name
"#{first_name} #{last_name} #{last_name}"
end
|
.name_with_prefix ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/ffaker/name_es.rb', line 19
def name_with_prefix
fetch_sample(
[
female_name_with_prefix,
male_name_with_prefix
]
)
end
|
.prefix ⇒ Object
52
53
54
|
# File 'lib/ffaker/name_es.rb', line 52
def prefix
fetch_sample(PREFIXES)
end
|