Sha256: f8076ac2c1389a676a3701add5abf70027b05c24c5a29a55d8f6f6360900f164

Contents?: true

Size: 206 Bytes

Versions: 138

Compression:

Stored size: 206 Bytes

Contents

require 'json'

def response(data = nil, opts = {})
  if data
    opts.merge! body: JSON.dump(data)
    opts[:headers] ||= {}
    opts[:headers].merge! 'Content-Type' => 'application/json'
  end
  opts
end

Version data entries

138 entries across 138 versions & 1 rubygems

Version Path
acfs-1.3.2 spec/support/response.rb
acfs-1.3.1 spec/support/response.rb
acfs-1.3.0 spec/support/response.rb
acfs-1.2.1 spec/support/response.rb
acfs-0.50.0 spec/support/response.rb
acfs-1.2.0 spec/support/response.rb
acfs-0.49.1 spec/support/response.rb
acfs-1.1.1 spec/support/response.rb
acfs-0.49.0 spec/support/response.rb
acfs-1.1.0 spec/support/response.rb
acfs-0.48.2 spec/support/response.rb
acfs-1.0.1 spec/support/response.rb
acfs-0.48.1 spec/support/response.rb
acfs-1.0.0 spec/support/response.rb
acfs-0.48.0 spec/support/response.rb
acfs-0.47.0 spec/support/response.rb
acfs-0.46.0 spec/support/response.rb
acfs-0.45.0 spec/support/response.rb
acfs-0.44.0 spec/support/response.rb
acfs-0.43.2 spec/support/response.rb