Sha256: 63016837a2128870d0360c375018946fe6a3fb481cbb6a32ea935bbc5354366e

Contents?: true

Size: 285 Bytes

Versions: 7

Compression:

Stored size: 285 Bytes

Contents

module Grape
  module Formatter
    module Json
      class << self

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

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
grape-0.3.2 lib/grape/formatter/json.rb
grape-0.3.1 lib/grape/formatter/json.rb
grape-0.3.0 lib/grape/formatter/json.rb
grape-0.2.6 lib/grape/formatter/json.rb
grape-0.2.5 lib/grape/formatter/json.rb
grape-0.2.4 lib/grape/formatter/json.rb
grape-0.2.3 lib/grape/formatter/json.rb