Module: Faker::IdentificationESCO
Constant Summary
collapse
- BLOOD_TYPE =
%w(A B O AB)
- LICENSE_CATEGORY =
%w(A B C)
Faker::IdentificationES::GENDERS
Instance Method Summary
collapse
const_missing, k, underscore
#gender
Instance Method Details
#blood_type ⇒ Object
30
31
32
33
|
# File 'lib/ffaker/identification_es_co.rb', line 30
def blood_type sign = %w(+ -).sample
"#{BLOOD_TYPE.sample}#{sign}"
end
|
#driver_license_category ⇒ Object
23
24
25
26
27
28
|
# File 'lib/ffaker/identification_es_co.rb', line 23
def driver_license_category
category = LICENSE_CATEGORY.sample
num = category == 'A' ? 1 + rand(2) : 1 + rand(3)
"#{category}#{num}"
end
|
#drivers_license ⇒ Object
Also known as:
id
16
17
18
19
|
# File 'lib/ffaker/identification_es_co.rb', line 16
def drivers_license
how_many_numbers = 6 + rand(8)
Faker.numerify("#" * how_many_numbers)
end
|
#expedition_date ⇒ Object
35
36
37
38
|
# File 'lib/ffaker/identification_es_co.rb', line 35
def expedition_date
today = Date.today
today - rand(today.year)
end
|