Class: Slash::Resource::Response
- Inherits:
-
Object
- Object
- Slash::Resource::Response
- Extended by:
- Forwardable
- Defined in:
- lib/slash/resource.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result, response, exception) ⇒ Response
constructor
A new instance of Response.
- #result! ⇒ Object
- #success? ⇒ Boolean
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
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
16 17 18 |
# File 'lib/slash/resource.rb', line 16 def exception @exception end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/slash/resource.rb', line 16 def response @response end |
#result ⇒ Object (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
25 26 27 |
# File 'lib/slash/resource.rb', line 25 def success? exception.nil? end |