Method: Finance::Transaction#difference

Defined in:
lib/finance/transaction.rb

#differenceDecNum

Returns the difference between the original transaction amount and the current amount.

Examples:

t = Transaction.new(500)
t.amount = 750
t.difference #=> DecNum('250')

Returns:

  • (DecNum)

    the difference between the original transaction amount and the current amount



37
38
39
# File 'lib/finance/transaction.rb', line 37

def difference
  @amount - @original
end