Class: OFX::Transaction
- Inherits:
-
Base::Entity
- Object
- Base::Entity
- OFX::Transaction
- Defined in:
- lib/ofx_kit/transaction.rb
Overview
Represents a single financial transaction parsed from an OFX statement.
Example
txn = OFX.new("statement.ofx").transactions.first
txn.type #=> "DEBIT"
txn.name #=> "AMAZON.COM"
txn.amount #=> #<Money fractional:-5099 currency:USD>
txn.posted_at #=> 2024-01-15 00:00:00 +0000
txn.account #=> #<OFX::BankAccount ...>
txn.statement #=> #<OFX::BankStatement ...>
Instance Attribute Summary collapse
-
#amount ⇒ Object
Transaction amount as a Money object (or
nil). -
#amount_cents ⇒ Object
Transaction amount in the smallest currency unit, e.g.
-
#check_number ⇒ Object
Check number, if applicable (String or
nil). -
#fit_id ⇒ Object
Unique transaction identifier / FITID (String).
-
#memo ⇒ Object
Memo or additional description (String or
nil). -
#name ⇒ Object
Payee or description name (String or
nil). -
#occurred_at ⇒ Object
Date the transaction actually occurred (Time or
nil). -
#payee ⇒ Object
Payee name from the PAYEE field, when present (String or
nil). -
#posted_at ⇒ Object
Date the transaction was posted (Time or
nil). -
#ref_number ⇒ Object
Reference number (String or
nil). -
#sic ⇒ Object
Standard industry code / SIC (String or
nil). -
#type ⇒ Object
Transaction type, e.g.
Method Summary
Methods inherited from Base::Entity
ensure_attribute, wired_by_builder
Instance Attribute Details
#amount ⇒ Object
Transaction amount as a Money object (or nil).
25 26 27 |
# File 'lib/ofx_kit/transaction.rb', line 25 def amount @amount end |
#amount_cents ⇒ Object
Transaction amount in the smallest currency unit, e.g. cents (Integer or nil).
27 28 29 |
# File 'lib/ofx_kit/transaction.rb', line 27 def amount_cents @amount_cents end |
#check_number ⇒ Object
Check number, if applicable (String or nil).
35 36 37 |
# File 'lib/ofx_kit/transaction.rb', line 35 def check_number @check_number end |
#fit_id ⇒ Object
Unique transaction identifier / FITID (String).
17 18 19 |
# File 'lib/ofx_kit/transaction.rb', line 17 def fit_id @fit_id end |
#memo ⇒ Object
Memo or additional description (String or nil).
31 32 33 |
# File 'lib/ofx_kit/transaction.rb', line 31 def memo @memo end |
#name ⇒ Object
Payee or description name (String or nil).
29 30 31 |
# File 'lib/ofx_kit/transaction.rb', line 29 def name @name end |
#occurred_at ⇒ Object
Date the transaction actually occurred (Time or nil).
23 24 25 |
# File 'lib/ofx_kit/transaction.rb', line 23 def occurred_at @occurred_at end |
#payee ⇒ Object
Payee name from the PAYEE field, when present (String or nil).
33 34 35 |
# File 'lib/ofx_kit/transaction.rb', line 33 def payee @payee end |
#posted_at ⇒ Object
Date the transaction was posted (Time or nil).
21 22 23 |
# File 'lib/ofx_kit/transaction.rb', line 21 def posted_at @posted_at end |
#ref_number ⇒ Object
Reference number (String or nil).
37 38 39 |
# File 'lib/ofx_kit/transaction.rb', line 37 def ref_number @ref_number end |
#sic ⇒ Object
Standard industry code / SIC (String or nil).
39 40 41 |
# File 'lib/ofx_kit/transaction.rb', line 39 def sic @sic end |
#type ⇒ Object
Transaction type, e.g. “DEBIT”, “CREDIT”, “CHECK” (String).
19 20 21 |
# File 'lib/ofx_kit/transaction.rb', line 19 def type @type end |