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-0.21.1.rc1.b188 spec/support/response.rb
acfs-0.21.1 spec/support/response.rb
acfs-0.21.0.rc1.b187 spec/support/response.rb
acfs-0.21.1.rc1 spec/support/response.rb
acfs-0.21.0.rc1 spec/support/response.rb
acfs-0.22.0.rc1.b186 spec/support/response.rb
acfs-0.21.0.b185 spec/support/response.rb
acfs-0.20.0.dev.b184 spec/support/response.rb
acfs-0.21.0 spec/support/response.rb
acfs-0.20.0.dev.b183 spec/support/response.rb
acfs-0.20.0.dev.b182 spec/support/response.rb
acfs-0.20.0.dev.b181 spec/support/response.rb
acfs-0.20.0 spec/support/response.rb
acfs-0.19.0 spec/support/response.rb
acfs-0.18.0 spec/support/response.rb
acfs-0.17.0 spec/support/response.rb
acfs-0.16.0 spec/support/response.rb
acfs-0.15.0 spec/support/response.rb