Class: Coinbasepro::Api::APIResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/coinbasepro/api/api_response.rb

Overview

Encapsulate data for an API response

Direct Known Subclasses

EMHTTPResponse, NetHTTPResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resp) ⇒ APIResponse

Returns a new instance of APIResponse.



7
8
9
10
# File 'lib/coinbasepro/api/api_response.rb', line 7

def initialize(resp)
  @received_at = Time.now
  @response = resp
end

Instance Attribute Details

#received_atObject (readonly)

Returns the value of attribute received_at.



5
6
7
# File 'lib/coinbasepro/api/api_response.rb', line 5

def received_at
  @received_at
end

Instance Method Details

#bodyObject



16
17
18
# File 'lib/coinbasepro/api/api_response.rb', line 16

def body
  fail NotImplementedError
end

#headersObject



20
21
22
# File 'lib/coinbasepro/api/api_response.rb', line 20

def headers
  fail NotImplementedError
end

#rawObject



12
13
14
# File 'lib/coinbasepro/api/api_response.rb', line 12

def raw
  @response
end

#statusObject



24
25
26
# File 'lib/coinbasepro/api/api_response.rb', line 24

def status
  fail NotImplementedError
end