Method: Finrb::Cashflow::Function#values

Defined in:
lib/finrb/cashflows.rb

#values(x) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
36
37
38
39
40
# File 'lib/finrb/cashflows.rb', line 33

def values(x)
  value = @transactions.public_send(@function, Flt::DecNum.new(x.first.to_s))
  begin
    [BigDecimal(value.to_s)]
  rescue ArgumentError
    [0]
  end
end