Class: Bankroll::TotalPeriods

Inherits:
Object
  • Object
show all
Extended by:
Callable, Dry::Initializer
Defined in:
lib/bankroll/total_periods.rb

Instance Method Summary collapse

Instance Method Details

#callObject



19
20
21
22
23
# File 'lib/bankroll/total_periods.rb', line 19

def call
  return (-@present_value - @future_value) / @payment if interest_rate.zero?

  Bankroll::Decimal[periods]
end