Methods

Class/Module Index [+]

Quicksearch

Grape::Formatter::SerializableHash

Public Class Methods

call(object, env) click to toggle source
# File lib/grape/formatter/serializable_hash.rb, line 5
def call(object, env)
  return object if object.is_a?(String)
  return MultiJson.dump(serialize(object)) if serializable?(object)
  return object.to_json if object.respond_to?(:to_json)
  MultiJson.dump(object)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.