Class: Cryptoprocessing::APIResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptoprocessing/client/api_response.rb

Direct Known Subclasses

NetHTTPResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resp) ⇒ APIResponse

Returns a new instance of APIResponse.



8
9
10
11
# File 'lib/cryptoprocessing/client/api_response.rb', line 8

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/cryptoprocessing/client/api_response.rb', line 4

def client
  @client
end

#methodObject

Returns the value of attribute method.



5
6
7
# File 'lib/cryptoprocessing/client/api_response.rb', line 5

def method
  @method
end

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/cryptoprocessing/client/api_response.rb', line 6

def params
  @params
end

#received_atObject (readonly)

Returns the value of attribute received_at.



3
4
5
# File 'lib/cryptoprocessing/client/api_response.rb', line 3

def received_at
  @received_at
end

Instance Method Details

#bodyObject Also known as: data

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/cryptoprocessing/client/api_response.rb', line 17

def body
  raise NotImplementedError
end

#body=(body) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/cryptoprocessing/client/api_response.rb', line 23

def body=(body)
  raise NotImplementedError
end

#has_more?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/cryptoprocessing/client/api_response.rb', line 35

def has_more?
  body.has_key?('pagination') && body['pagination']['next_uri'] != nil
end

#headersObject

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/cryptoprocessing/client/api_response.rb', line 27

def headers
  raise NotImplementedError
end

#rawObject



13
14
15
# File 'lib/cryptoprocessing/client/api_response.rb', line 13

def raw
  @response
end

#statusObject

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/cryptoprocessing/client/api_response.rb', line 31

def status
  raise NotImplementedError
end