Class: LunchMoney::Objects::Split

Inherits:
TransactionModificationBase show all
Defined in:
lib/lunchmoney/objects/split.rb

Overview

Object used to split a transaction when updating lunchmoney.dev/#update-transaction

Instance Attribute Summary collapse

Attributes inherited from TransactionModificationBase

#category_id, #date, #notes, #payee

Instance Method Summary collapse

Methods inherited from Object

#serialize

Constructor Details

#initialize(amount:, payee: nil, date: nil, category_id: nil, notes: nil) ⇒ void

Parameters:

  • amount (Number, String)
  • payee (String, nil) (defaults to: nil)
  • date (String, nil) (defaults to: nil)
  • category_id (Integer, nil) (defaults to: nil)
  • notes (String, nil) (defaults to: nil)


22
23
24
25
# File 'lib/lunchmoney/objects/split.rb', line 22

def initialize(amount:, payee: nil, date: nil, category_id: nil, notes: nil)
  super(payee:, date:, category_id:, notes:)
  @amount = amount
end

Instance Attribute Details

#amountNumber, String

Returns:



11
12
13
# File 'lib/lunchmoney/objects/split.rb', line 11

def amount
  @amount
end