Class: Gnucash::AccountTransaction

Inherits:
Object
  • Object
show all
Includes:
Support::LightInspect
Defined in:
lib/gnucash/account_transaction.rb

Overview

Class to link a transaction object to an Account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::LightInspect

#inspect

Constructor Details

#initialize(real_txn, value) ⇒ AccountTransaction

Construct an AccountTransaction object.

This method is used internally when building a Transaction object.

Parameters:

  • real_txn (Transaction)

    The linked Transaction object.

  • value (Value)

    The value of the Transaction split for this account



17
18
19
20
# File 'lib/gnucash/account_transaction.rb', line 17

def initialize(real_txn, value)
  @real_txn = real_txn
  @value = value
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object

Pass through any missing method calls to the linked Transaction object.



23
24
25
# File 'lib/gnucash/account_transaction.rb', line 23

def method_missing(*args)
  @real_txn.send(*args)
end

Instance Attribute Details

#valueValue (readonly)

Returns The transaction value for the linked account.

Returns:

  • (Value)

    The transaction value for the linked account.



7
8
9
# File 'lib/gnucash/account_transaction.rb', line 7

def value
  @value
end

Instance Method Details

#attributesArray<Symbol>

Attributes available for inspection

Returns:

  • (Array<Symbol>)

    Attributes used to build the inspection string

See Also:



31
32
33
# File 'lib/gnucash/account_transaction.rb', line 31

def attributes
  %i[value]
end