Class: OFX::Transaction

Inherits:
Base::Entity show all
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.      #=> #<OFX::BankAccount ...>
txn.statement    #=> #<OFX::BankStatement ...>

Instance Attribute Summary collapse

Method Summary

Methods inherited from Base::Entity

ensure_attribute, wired_by_builder

Instance Attribute Details

#amountObject

Transaction amount as a Money object (or nil).



25
26
27
# File 'lib/ofx_kit/transaction.rb', line 25

def amount
  @amount
end

#amount_centsObject

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_numberObject

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_idObject

Unique transaction identifier / FITID (String).



17
18
19
# File 'lib/ofx_kit/transaction.rb', line 17

def fit_id
  @fit_id
end

#memoObject

Memo or additional description (String or nil).



31
32
33
# File 'lib/ofx_kit/transaction.rb', line 31

def memo
  @memo
end

#nameObject

Payee or description name (String or nil).



29
30
31
# File 'lib/ofx_kit/transaction.rb', line 29

def name
  @name
end

#occurred_atObject

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

#payeeObject

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_atObject

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_numberObject

Reference number (String or nil).



37
38
39
# File 'lib/ofx_kit/transaction.rb', line 37

def ref_number
  @ref_number
end

#sicObject

Standard industry code / SIC (String or nil).



39
40
41
# File 'lib/ofx_kit/transaction.rb', line 39

def sic
  @sic
end

#typeObject

Transaction type, e.g. “DEBIT”, “CREDIT”, “CHECK” (String).



19
20
21
# File 'lib/ofx_kit/transaction.rb', line 19

def type
  @type
end