Class: OFXReader::Parser::OFX102

Inherits:
Base
  • Object
show all
Defined in:
lib/ofx_reader/parser/ofx_102.rb

Constant Summary collapse

ACCOUNT_TYPES =
[
  "CHECKING",
  "SAVINGS",
  "CREDITCARD",
  "CREDITLINE",
  "INVESTMENT",
  "MONEYMRKT",
]
TRANSACTION_TYPES =
[
  'ATM', 'CASH', 'CHECK', 'CREDIT', 'DEBIT', 'DEP', 'DIRECTDEBIT',
  'DIRECTDEP', 'DIV', 'FEE', 'INT', 'OTHER', 'PAYMENT', 'POS',
  'REPEATPMT', 'SRVCHG', 'XFER',
].inject({}) { |hash, type| hash.tap { |h| h[type] = type.downcase } }

Instance Attribute Summary

Attributes inherited from Base

#body, #content, #headers

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OFXReader::Parser::Base

Instance Method Details

#accountObject



20
21
22
23
24
25
# File 'lib/ofx_reader/parser/ofx_102.rb', line 20

def 
  {
    bank_id: body.search('BANKACCTFROM BANKID').inner_text,
    account_id: body.search('BANKACCTFROM ACCTID').inner_text,
  }
end

#transactionsObject



27
28
29
30
31
# File 'lib/ofx_reader/parser/ofx_102.rb', line 27

def transactions
  body.search('BANKTRANLIST STMTTRN').map do |node|
    build_transaction(node)
  end
end