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