Sha256: 36495d8b54ff54f31a4ce4d62c85a2daf20fced4471bcad3c9762b83a7e7cb21

Contents?: true

Size: 272 Bytes

Versions: 12

Compression:

Stored size: 272 Bytes

Contents

# frozen_string_literal: true

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

          ::Grape::Json.dump(object)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
grape-2.2.0 lib/grape/formatter/json.rb
grape-2.1.3 lib/grape/formatter/json.rb
grape-2.1.2 lib/grape/formatter/json.rb
grape-2.1.1 lib/grape/formatter/json.rb
grape-2.1.0 lib/grape/formatter/json.rb
grape-2.0.0 lib/grape/formatter/json.rb
grape-1.8.0 lib/grape/formatter/json.rb
grape-1.7.1 lib/grape/formatter/json.rb
grape-1.7.0 lib/grape/formatter/json.rb
grape-1.6.2 lib/grape/formatter/json.rb
grape-1.6.1 lib/grape/formatter/json.rb
grape-1.6.0 lib/grape/formatter/json.rb