Module: Grape::Formatter::Json

Defined in:
lib/grape/formatter/json.rb

Class Method Summary collapse

Class Method Details

.call(object, env) ⇒ Object


6
7
8
9
# File 'lib/grape/formatter/json.rb', line 6

def call(object, env)
  return object.to_json if object.respond_to?(:to_json)
  MultiJson.dump(object)
end