lib/grape/roar/formatter.rb in grape-roar-0.1.0 vs lib/grape/roar/formatter.rb in grape-roar-0.2.0
- old
+ new
@@ -1,11 +1,10 @@
module Grape
module Formatter
module Roar
class << self
def call(object, env)
- return object.to_json(env: env) if object.respond_to?(:to_json)
- MultiJson.dump(object)
+ object.respond_to?(:to_json) ? object.to_json(env: env) : MultiJson.dump(object)
end
end
end
end
end