Class: CNAB240::BancoABC::Services::ParseLine

Inherits:
Object
  • Object
show all
Defined in:
lib/cnab240/bancoabc/services/parse_line.rb

Constant Summary collapse

HEADER =
"0"
REGISTERT =
"1"
REGISTERU =
"2"
TRAILLER =
"9"

Class Method Summary collapse

Class Method Details

.call(line, type) ⇒ Object



12
13
14
15
16
17
# File 'lib/cnab240/bancoabc/services/parse_line.rb', line 12

def self.call(line, type)
  return CNAB240::BancoABC::Entities::Header.new(line) if type == HEADER
  return CNAB240::BancoABC::Entities::RegisterT.new(line) if type == REGISTERT
  return CNAB240::BancoABC::Entities::RegisterU.new(line) if type == REGISTERU
  return CNAB240::BancoABC::Entities::Trailler.new(line) if type == TRAILLER
end