Module: FFaker::IdentificationESCL

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

Constant Summary

Constants included from IdentificationES

FFaker::IdentificationES::GENDERS

Instance Method Summary collapse

Methods included from IdentificationES

gender

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

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/ffaker/identification_es_cl.rb', line 14

def rut
  # Rut is gonna be between 1.000.000 and 24.999.999
  n = rand(1_000_000...25_000_000)
  "#{n}-#{dv(n)}"
end