class Coinbase::Wallet::NetHTTPResponse
Net-Http response object
Public Instance Methods
body()
click to toggle source
# File lib/coinbase/wallet/adapters/net_http.rb, line 44 def body JSON.parse(@response.body) rescue {} end
body=(body)
click to toggle source
# File lib/coinbase/wallet/adapters/net_http.rb, line 48 def body=(body) @response.body = body.to_json end
data()
click to toggle source
# File lib/coinbase/wallet/adapters/net_http.rb, line 52 def data body['data'] end
headers()
click to toggle source
# File lib/coinbase/wallet/adapters/net_http.rb, line 56 def headers out = @response.to_hash.map do |key, val| [ key.upcase.gsub('_', '-'), val.count == 1 ? val.first : val ] end out.to_h end
status()
click to toggle source
# File lib/coinbase/wallet/adapters/net_http.rb, line 63 def status @response.code.to_i end