Module: FFaker::IdentificationPL
- Extended by:
- IdentificationPL, ModuleUtils
- Included in:
- IdentificationPL
- Defined in:
- lib/ffaker/identification_pl.rb
Instance Method Summary collapse
-
#drivers_license ⇒ Object
Polish driver’s licence number en.wikipedia.org/wiki/Driving_licence_in_Poland.
-
#identity_card ⇒ Object
(also: #id)
Polish identity card number en.wikipedia.org/wiki/Polish_identity_card.
-
#pesel ⇒ Object
Polish national identification number en.wikipedia.org/wiki/PESEL.
Methods included from ModuleUtils
const_missing, k, luhn_check, underscore, unique
Methods included from RandomUtils
#fetch_sample, #rand, #shuffle
Instance Method Details
#drivers_license ⇒ Object
Polish driver’s licence number en.wikipedia.org/wiki/Driving_licence_in_Poland
33 34 35 |
# File 'lib/ffaker/identification_pl.rb', line 33 def drivers_license FFaker.numerify('#####/##/####') end |
#identity_card ⇒ Object Also known as: id
Polish identity card number en.wikipedia.org/wiki/Polish_identity_card
22 23 24 25 26 27 |
# File 'lib/ffaker/identification_pl.rb', line 22 def identity_card letter_part = FFaker.letterify('???').upcase number_part = FFaker.numerify('#####') checksum = identity_card_checksum(letter_part, number_part) "#{letter_part}#{checksum}#{number_part}" end |
#pesel ⇒ Object
Polish national identification number en.wikipedia.org/wiki/PESEL
12 13 14 15 16 17 18 |
# File 'lib/ffaker/identification_pl.rb', line 12 def pesel date = generate_valid_pesel_date birthdate = pesel_birthdate(date) serial_number = FFaker.numerify('####') checksum = pesel_checksum(birthdate, serial_number) "#{birthdate}#{serial_number}#{checksum}" end |