Module: Utils::BancoSecurity

Extended by:
BancoSecurity
Included in:
BancoSecurity
Defined in:
lib/bank_api/utils/banco_security.rb

Constant Summary collapse

BANKS =
{
  banco_de_chile: 'Banco Chile-Edwards-Citi',
  banco_consorcio: 'Banco Consorcio',
  banco_del_desarrollo: 'Banco del Desarrollo',
  banco_estado: 'Banco Estado',
  banco_falabella: 'Banco Falabella',
  banco_internacional: 'Banco Internacional',
  banco_itau: 'Banco Ita\u00FA',
  banco_paris: 'Banco Paris',
  banco_rabobank: 'Banco Rabobank',
  banco_ripley: 'Banco Ripley',
  banco_santander: 'Banco Santander',
  banco_security: 'Banco Security',
  bbva: 'BBVA',
  bci: 'BCI',
  bice: 'BICE',
  coopeuch: 'COOPEUCH',
  corpbanca: 'Corpbanca',
  hsbc: 'HSBC BANK',
  scotiabank: 'Scotiabank'
}
ACCOUNT_TYPES =
{
  cuenta_corriente: 'Cuenta Corriente',
  cuenta_vista: 'Cuenta Vista',
  cuenta_de_ahorro: 'Cuenta de Ahorro'
}

Instance Method Summary collapse

Instance Method Details

#account_type(type) ⇒ Object



41
42
43
# File 'lib/bank_api/utils/banco_security.rb', line 41

def (type)
  ACCOUNT_TYPES[type]
end

#bank_name(bank) ⇒ Object



27
28
29
# File 'lib/bank_api/utils/banco_security.rb', line 27

def bank_name(bank)
  BANKS[bank]
end

#format_rut(rut) ⇒ Object



49
50
51
52
53
# File 'lib/bank_api/utils/banco_security.rb', line 49

def format_rut(rut)
  verification_digit = rut[-1]
  without_verification_digit = rut[0..-2].reverse.scan(/.{1,3}/).join(".").reverse
  "#{without_verification_digit}-#{verification_digit}"
end

#valid_account_typesObject



45
46
47
# File 'lib/bank_api/utils/banco_security.rb', line 45

def 
  ACCOUNT_TYPES.keys.sort
end

#valid_banksObject



31
32
33
# File 'lib/bank_api/utils/banco_security.rb', line 31

def valid_banks
  BANKS.keys.sort
end