Class: Coinbasepro::Api::NetHTTPResponse

Inherits:
APIResponse show all
Defined in:
lib/coinbasepro/api/adapters/net_http.rb

Overview

Net-Http response object

Instance Attribute Summary

Attributes inherited from APIResponse

#received_at

Instance Method Summary collapse

Methods inherited from APIResponse

#initialize, #raw

Constructor Details

This class inherits a constructor from Coinbasepro::Api::APIResponse

Instance Method Details

#bodyObject



50
51
52
# File 'lib/coinbasepro/api/adapters/net_http.rb', line 50

def body
  @response.body
end

#headersObject



54
55
56
57
58
59
# File 'lib/coinbasepro/api/adapters/net_http.rb', line 54

def headers
  out = @response.to_hash.map do |key, val|
    [ key.upcase.gsub('_', '-'), val.count == 1 ? val.first : val ]
  end
  out.to_h
end

#statusObject



61
62
63
# File 'lib/coinbasepro/api/adapters/net_http.rb', line 61

def status
  @response.code.to_i
end