Sha256: fcc0bafd630063d7f736d9583ff15976ddb33bb3f7062a1723600d68611798cb

Contents?: true

Size: 323 Bytes

Versions: 4

Compression:

Stored size: 323 Bytes

Contents

module ContentTypeHelpers
  %w(put patch post delete).each do |method|
    define_method :"#{method}_with_json" do |uri, params = {}, env = {}, &block|
      params = params.to_json
      env["CONTENT_TYPE"] ||= "application/json"
      send(method, uri, params, env, &block)
    end
  end
end

include(ContentTypeHelpers)

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
grape-security-0.8.0 spec/support/content_type_helpers.rb
grape-0.9.0 spec/support/content_type_helpers.rb
grape-0.8.0 spec/support/content_type_helpers.rb
grape-0.7.0 spec/support/content_type_helpers.rb