Sha256: 8e5d3e3cede92d0d6cbeb958f522d13b39880043c8eff6243728fa5e1fc78f94

Contents?: true

Size: 271 Bytes

Versions: 10

Compression:

Stored size: 271 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

10 entries across 10 versions & 2 rubygems

Version Path
grape-1.5.3 lib/grape/formatter/json.rb
grape-1.5.2 lib/grape/formatter/json.rb
grape-1.5.1 lib/grape/formatter/json.rb
grape-1.5.0 lib/grape/formatter/json.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/lib/grape/formatter/json.rb
grape-1.4.0 lib/grape/formatter/json.rb
grape-1.3.3 lib/grape/formatter/json.rb
grape-1.3.2 lib/grape/formatter/json.rb
grape-1.3.1 lib/grape/formatter/json.rb
grape-1.3.0 lib/grape/formatter/json.rb