Module: Faker::IdentificationESCL

Extended by:
IdentificationES, IdentificationESCL
Included in:
IdentificationESCL
Defined in:
lib/ffakerer/identification_es_cl.rb

Constant Summary

Constants included from IdentificationES

Faker::IdentificationES::GENDERS

Instance Method Summary collapse

Methods included from IdentificationES

gender

Methods included from ModuleUtils

#const_missing, #k, #underscore

Instance Method Details

#rutObject

RUT is the Chilean ID, followed by format: XX.XXX.XXX - Y es.wikipedia.org/wiki/Rol_%C3%9Anico_Tributario

The last Y is a modulo 11 validation code. In the case the result is 10, it will be replaced by a ‘K’ character


14
15
16
17
18
# File 'lib/ffakerer/identification_es_cl.rb', line 14

def rut
  # Rut is gonna be between 1.000.000 and 24.999.999
  n = Kernel.rand(24000000) + 1000000
  "#{n}-#{dv(n)}"
end