Class: TxghQueue::Result
- Inherits:
-
Object
- Object
- TxghQueue::Result
- Defined in:
- lib/txgh-queue/result.rb
Instance Attribute Summary collapse
-
#response_or_error ⇒ Object
readonly
Returns the value of attribute response_or_error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #error ⇒ Object
- #has_error? ⇒ Boolean
- #has_response? ⇒ Boolean
-
#initialize(status, response_or_error) ⇒ Result
constructor
A new instance of Result.
- #response ⇒ Object
Constructor Details
#initialize(status, response_or_error) ⇒ Result
Returns a new instance of Result.
5 6 7 8 |
# File 'lib/txgh-queue/result.rb', line 5 def initialize(status, response_or_error) @status = status @response_or_error = response_or_error end |
Instance Attribute Details
#response_or_error ⇒ Object (readonly)
Returns the value of attribute response_or_error.
3 4 5 |
# File 'lib/txgh-queue/result.rb', line 3 def response_or_error @response_or_error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/txgh-queue/result.rb', line 3 def status @status end |
Instance Method Details
#error ⇒ Object
22 23 24 |
# File 'lib/txgh-queue/result.rb', line 22 def error return response_or_error if has_error? end |
#has_error? ⇒ Boolean
18 19 20 |
# File 'lib/txgh-queue/result.rb', line 18 def has_error? response_or_error.is_a?(Exception) end |
#has_response? ⇒ Boolean
10 11 12 |
# File 'lib/txgh-queue/result.rb', line 10 def has_response? response_or_error.is_a?(TxghServer::Response) end |
#response ⇒ Object
14 15 16 |
# File 'lib/txgh-queue/result.rb', line 14 def response return response_or_error if has_response? end |