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.



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

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

  @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.



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

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

#successObject (readonly) Also known as: successful?

Returns the value of attribute success.



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

def success
  @success
end