Class: SynapseClient::APIOperations::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse_client/api_operations/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, cookies = nil) ⇒ Response

Returns a new instance of Response.



11
12
13
14
15
16
17
18
19
# File 'lib/synapse_client/api_operations/response.rb', line 11

def initialize(response, cookies=nil)
  response = Map.new(response)

  @status_code = response.delete(:status_code)
  @success     = response.delete(:success)
  @error_msg   = response.delete(:reason)
  @data        = response
  @cookies     = cookies
end

Instance Attribute Details

#cookiesObject (readonly)

Returns the value of attribute cookies.



6
7
8
# File 'lib/synapse_client/api_operations/response.rb', line 6

def cookies
  @cookies
end

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/synapse_client/api_operations/response.rb', line 4

def data
  @data
end

#error_msgObject (readonly)

Returns the value of attribute error_msg.



5
6
7
# File 'lib/synapse_client/api_operations/response.rb', line 5

def error_msg
  @error_msg
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



7
8
9
# File 'lib/synapse_client/api_operations/response.rb', line 7

def status_code
  @status_code
end

#successObject (readonly) Also known as: successful?

Returns the value of attribute success.



8
9
10
# File 'lib/synapse_client/api_operations/response.rb', line 8

def success
  @success
end