This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Grape | |
module Formatter | |
module FastJsonapi | |
class << self | |
def call(object, _env) | |
return object if object.is_a?(String) | |
return ::Grape::Json.dump(serialize(object)) if serializable?(object) | |
return object.to_json if object.respond_to?(:to_json) | |
::Grape::Json.dump(object) |