class JMESPath::Nodes::ToStringFunction

Public Instance Methods

call(args) click to toggle source
# File lib/jmespath/nodes/function.rb, line 374
def call(args)
  if args.count == 1
    value = args.first
    value.respond_to?(:to_str) ? value.to_str : value.to_json
  else
    return maybe_raise Errors::InvalidArityError, 'function to_string() expects one argument'
  end
end