class Gateway::TrailerParser

Constants

BoletoTransactionDataCount
CreditCardTransactionDataCount
OnlineDebitTransactionDataCount
OrderDataCount

Public Instance Methods

Parse(elements) click to toggle source
# File lib/gateway/Parsers/trailer_parser.rb, line 3
def Parse(elements)
  if elements.length < 5
    throw('The expected parameter count is 5')
  end

  trailer = Trailer.new
  trailer.OrderDataCount = elements[1]
  trailer.CreditCardTransactionDataCount = elements[2]
  trailer.BoletoTransactionDataCount = elements[3]
  trailer.OnlineDebitTransactionDataCount = elements[4].chomp

  return trailer
end