From 1c3ed4f547de32d3411fcff0a7d4419b408dca5c Mon Sep 17 00:00:00 2001 From: Brian Loomis Date: Thu, 12 Dec 2019 08:33:15 -0700 Subject: [PATCH] Updated for Ruby 2.5, Suppress --- lib/finance/cashflows.rb | 4 ++-- lib/finance/decimal.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/finance/cashflows.rb b/lib/finance/cashflows.rb index 985ca36..ffc1996 100644 --- a/lib/finance/cashflows.rb +++ b/lib/finance/cashflows.rb @@ -22,7 +22,7 @@ class Function values.each do |key, value| define_method key do - BigDecimal.new value + BigDecimal(value) end end @@ -33,7 +33,7 @@ def initialize(transactions, function) def values(x) value = @transactions.send(@function, Flt::DecNum.new(x[0].to_s)) - [ BigDecimal.new(value.to_s) ] + [ BigDecimal(value.to_s) ] end end diff --git a/lib/finance/decimal.rb b/lib/finance/decimal.rb index 28a72d4..1bbdec5 100644 --- a/lib/finance/decimal.rb +++ b/lib/finance/decimal.rb @@ -7,7 +7,7 @@ end DecNum.context.define_conversion_to(BigDecimal) do |x| - BigDecimal.new(x.to_s) + BigDecimal(x.to_s) end class Numeric