Class: LunchMoney::Objects::ChildTransaction

Inherits:
TransactionBase show all
Defined in:
lib/lunchmoney/objects/child_transaction.rb

Overview

Slimmed down version of https://lunchmoney.dev/#transaction-object used in the children field of a transaction object with an additional formatted_date` field

Instance Attribute Summary collapse

Attributes inherited from TransactionBase

#amount, #asset_id, #currency, #date, #id, #notes, #payee, #plaid_account_id, #to_base

Instance Method Summary collapse

Methods inherited from Object

#serialize

Constructor Details

#initialize(id:, date:, amount:, currency:, to_base:, payee:, formatted_date:, notes: nil, asset_id: nil, plaid_account_id: nil) ⇒ ChildTransaction

Returns a new instance of ChildTransaction.



28
29
30
31
32
# File 'lib/lunchmoney/objects/child_transaction.rb', line 28

def initialize(id:, date:, amount:, currency:, to_base:, payee:, formatted_date:, notes: nil, asset_id: nil,
  plaid_account_id: nil)
  super(id:, date:, amount:, currency:, to_base:, payee:, notes:, asset_id:, plaid_account_id:)
  @formatted_date = formatted_date
end

Instance Attribute Details

#formatted_dateObject

Returns the value of attribute formatted_date.



12
13
14
# File 'lib/lunchmoney/objects/child_transaction.rb', line 12

def formatted_date
  @formatted_date
end