Class: Slash::Resource::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/slash/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, response, exception) ⇒ Response

Returns a new instance of Response.



12
13
14
# File 'lib/slash/resource.rb', line 12

def initialize(result, response, exception)
  @result, @response, @exception = result, response, exception
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



16
17
18
# File 'lib/slash/resource.rb', line 16

def exception
  @exception
end

#responseObject (readonly)

Returns the value of attribute response.



16
17
18
# File 'lib/slash/resource.rb', line 16

def response
  @response
end

#resultObject (readonly)

Returns the value of attribute result.



16
17
18
# File 'lib/slash/resource.rb', line 16

def result
  @result
end

Instance Method Details

#result!Object



20
21
22
23
# File 'lib/slash/resource.rb', line 20

def result!
  raise exception if exception
  result
end

#success?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/slash/resource.rb', line 25

def success?
  exception.nil?
end