Module: Faker::IdentificationESCO
Constant Summary
collapse
- BLOOD_TYPE =
k %w(A B O AB)
- LICENSE_CATEGORY =
k %w(A B C)
Faker::IdentificationES::GENDERS
Instance Method Summary
collapse
const_missing, k, underscore
#gender
Instance Method Details
#blood_type ⇒ Object
27
28
29
30
|
# File 'lib/ffakerer/identification_es_co.rb', line 27
def blood_type
sign = %w(+ -).shuffle.shift
BLOOD_TYPE.rand.concat sign
end
|
#driver_license_category ⇒ Object
20
21
22
23
24
25
|
# File 'lib/ffakerer/identification_es_co.rb', line 20
def driver_license_category
category = LICENSE_CATEGORY.rand
num = category == 'A' ? 1 + rand(2) : 1 + rand(3)
category.concat(num.to_s)
end
|
#drivers_license ⇒ Object
Also known as:
id
13
14
15
16
|
# File 'lib/ffakerer/identification_es_co.rb', line 13
def drivers_license
how_many_numbers = 6 + rand(8)
Faker.numerify("#" * how_many_numbers)
end
|
#expedition_date ⇒ Object
32
33
34
35
|
# File 'lib/ffakerer/identification_es_co.rb', line 32
def expedition_date
today = Date.today
today - rand(today.year)
end
|