lib/finrb/amortization.rb in finrb-0.1.3 vs lib/finrb/amortization.rb in finrb-0.1.4
- old
+ new
@@ -138,10 +138,10 @@
if @balance.nonzero?
@transactions.reverse.find(&:payment?).amount -= @balance
@balance = 0
end
- @payment = (payments[0] if @rates.length == 1)
+ @payment = (payments.first if @rates.length == 1)
@transactions.freeze
end
# @return [Integer] the time required to pay off the loan, in months