Class: Coinbase::Exchange::EMHTTPResponse

Inherits:
APIResponse
  • Object
show all
Defined in:
lib/coinbase/exchange/adapters/em_http.rb

Overview

EM-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 Coinbase::Exchange::APIResponse

Instance Method Details

#bodyObject



67
68
69
# File 'lib/coinbase/exchange/adapters/em_http.rb', line 67

def body
  @response.response
end

#headersObject



71
72
73
74
75
76
# File 'lib/coinbase/exchange/adapters/em_http.rb', line 71

def headers
  out = @response.response_header.map do |key, val|
    [ key.upcase.gsub('_', '-'), val ]
  end
  out.to_h
end

#statusObject



78
79
80
# File 'lib/coinbase/exchange/adapters/em_http.rb', line 78

def status
  @response.response_header.status
end