Class: LunchMoney::Objects::TransactionBase

Inherits:
Object
  • Object
show all
Defined in:
lib/lunchmoney/objects/transaction_base.rb

Overview

Slimmed down version of lunchmoney.dev/#transaction-object used as a base for other transaction objects

Direct Known Subclasses

ChildTransaction, Transaction

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#serialize

Constructor Details

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

Parameters:

  • id (Integer)
  • date (String)
  • amount (String)
  • currency (String)
  • to_base (Number)
  • payee (String)
  • notes (String, nil) (defaults to: nil)
  • asset_id (Integer, nil) (defaults to: nil)
  • plaid_account_id (Integer, nil) (defaults to: nil)


39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/lunchmoney/objects/transaction_base.rb', line 39

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

Instance Attribute Details

#amountString

Returns:

  • (String)


18
19
20
# File 'lib/lunchmoney/objects/transaction_base.rb', line 18

def amount
  @amount
end

#asset_idInteger?

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/lunchmoney/objects/transaction_base.rb', line 15

def asset_id
  @asset_id
end

#currencyString

Returns:

  • (String)


18
19
20
# File 'lib/lunchmoney/objects/transaction_base.rb', line 18

def currency
  @currency
end

#dateString

Returns:

  • (String)


18
19
20
# File 'lib/lunchmoney/objects/transaction_base.rb', line 18

def date
  @date
end

#idInteger

Returns:

  • (Integer)


9
10
11
# File 'lib/lunchmoney/objects/transaction_base.rb', line 9

def id
  @id
end

#notesString?

Returns:

  • (String, nil)


24
25
26
# File 'lib/lunchmoney/objects/transaction_base.rb', line 24

def notes
  @notes
end

#payeeString

Returns:

  • (String)


18
19
20
# File 'lib/lunchmoney/objects/transaction_base.rb', line 18

def payee
  @payee
end

#plaid_account_idInteger?

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/lunchmoney/objects/transaction_base.rb', line 15

def 
  @plaid_account_id
end

#to_baseNumber

Returns:



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

def to_base
  @to_base
end