Sha256: 30543d5180942d9d372ffec7370b7c95ab2f30ad9e8d926bf7303b03d50daf76

Contents?: true

Size: 236 Bytes

Versions: 11

Compression:

Stored size: 236 Bytes

Contents

module Grape
  module Formatter
    module Json
      class << self
        def call(object, _env)
          return object.to_json if object.respond_to?(:to_json)
          MultiJson.dump(object)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
grape-0.19.2 lib/grape/formatter/json.rb
grape-0.19.1 lib/grape/formatter/json.rb
grape-0.19.0 lib/grape/formatter/json.rb
grape-0.18.0 lib/grape/formatter/json.rb
grape-0.17.0 lib/grape/formatter/json.rb
grape-0.16.2 lib/grape/formatter/json.rb
grape-0.16.1 lib/grape/formatter/json.rb
grape-0.15.0 lib/grape/formatter/json.rb
grape-0.14.0 lib/grape/formatter/json.rb
grape-0.13.0 lib/grape/formatter/json.rb
grape-0.12.0 lib/grape/formatter/json.rb