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.23.2.b205 spec/support/response.rb
acfs-0.23.2.b204 spec/support/response.rb
acfs-0.23.2.b203 spec/support/response.rb
acfs-0.23.2.b200 spec/support/response.rb
acfs-0.23.2.b199 spec/support/response.rb
acfs-0.23.2 spec/support/response.rb
acfs-0.23.1.b198 spec/support/response.rb
acfs-0.23.1 spec/support/response.rb
acfs-0.23.0.b197 spec/support/response.rb
acfs-0.22.2.b196 spec/support/response.rb
acfs-0.23.0 spec/support/response.rb
acfs-0.22.2.b194 spec/support/response.rb
acfs-0.22.2.b193 spec/support/response.rb
acfs-0.22.2 spec/support/response.rb
acfs-0.22.1.b192 spec/support/response.rb
acfs-0.22.1 spec/support/response.rb
acfs-0.22.0.b191 spec/support/response.rb
acfs-0.22.0.b190 spec/support/response.rb
acfs-0.22.0 spec/support/response.rb
acfs-0.21.1.b189 spec/support/response.rb