Class: AFMotion::HTTPResult
- Inherits:
-
Object
- Object
- AFMotion::HTTPResult
- Defined in:
- lib/afmotion/http_result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#object ⇒ Object
Returns the value of attribute object.
-
#operation ⇒ Object
Returns the value of attribute operation.
Instance Method Summary collapse
- #body ⇒ Object
- #failure? ⇒ Boolean
-
#initialize(operation, responseObject, error) ⇒ HTTPResult
constructor
A new instance of HTTPResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(operation, responseObject, error) ⇒ HTTPResult
Returns a new instance of HTTPResult.
5 6 7 8 9 |
# File 'lib/afmotion/http_result.rb', line 5 def initialize(operation, responseObject, error) self.operation = operation self.object = responseObject self.error = error end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
3 4 5 |
# File 'lib/afmotion/http_result.rb', line 3 def error @error end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/afmotion/http_result.rb', line 3 def object @object end |
#operation ⇒ Object
Returns the value of attribute operation.
3 4 5 |
# File 'lib/afmotion/http_result.rb', line 3 def operation @operation end |
Instance Method Details
#body ⇒ Object
19 20 21 22 23 |
# File 'lib/afmotion/http_result.rb', line 19 def body if operation && operation.responseString operation.responseString end end |
#failure? ⇒ Boolean
15 16 17 |
# File 'lib/afmotion/http_result.rb', line 15 def failure? !!error end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/afmotion/http_result.rb', line 11 def success? !failure? end |