class JMESPath::Nodes::SumFunction
def call(args)
def call(args) if args.count == 1 && args.first.respond_to?(:to_ary) args.first.to_ary.inject(0) do |sum, n| if Numeric === n sum + n else return maybe_raise Errors::InvalidTypeError, 'function sum() expects values to be numeric' end end else return maybe_raise Errors::InvalidArityError, 'function sum() expects one argument' end end