Class: OFXReader::Parser::OFX102
- Inherits:
-
Base
- Object
- Base
- OFXReader::Parser::OFX102
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
Instance Method Details
#account ⇒ Object
20
21
22
23
24
25
|
# File 'lib/ofx_reader/parser/ofx_102.rb', line 20
def account
{
bank_id: body.search('BANKACCTFROM BANKID').inner_text,
account_id: body.search('BANKACCTFROM ACCTID').inner_text,
}
end
|
#transactions ⇒ Object
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
|