Class: OFX::Balance

Inherits:
OFX::Base::Entity show all
Defined in:
lib/ofx_kit/balance.rb

Overview

Represents the ledger balance of an account at a specific point in time.

Example

bal = OFX.new("statement.ofx").balance
bal.amount.format  #=> "$2,500.00"
bal.amount_cents   #=> 250000
bal.posted_at      #=> 2024-01-31 00:00:00 +0000
bal.        #=> #<OFX::BankAccount ...>

Instance Attribute Summary collapse

Method Summary

Methods inherited from OFX::Base::Entity

ensure_attribute, wired_by_builder

Instance Attribute Details

#amountObject

Closing balance as a Money object (or nil).



15
16
17
# File 'lib/ofx_kit/balance.rb', line 15

def amount
  @amount
end

#amount_centsObject

Closing balance in the smallest currency unit, e.g. cents (Integer or nil).



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

def amount_cents
  @amount_cents
end

#posted_atObject

Date the balance was posted (Time or nil).



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

def posted_at
  @posted_at
end