Class: Async::Container::Thread::Status
- Inherits:
-
Object
- Object
- Async::Container::Thread::Status
- Defined in:
- lib/async/container/thread.rb
Overview
A pseudo exit-status wrapper.
Instance Method Summary collapse
-
#initialize(error = nil) ⇒ Status
constructor
Initialise the status.
-
#success? ⇒ Boolean
Whether the status represents a successful outcome.
-
#to_s ⇒ Object
A human readable representation of the status.
Constructor Details
#initialize(error = nil) ⇒ Status
Initialise the status.
171 172 173 |
# File 'lib/async/container/thread.rb', line 171 def initialize(error = nil) @error = error end |
Instance Method Details
#success? ⇒ Boolean
Whether the status represents a successful outcome.
177 178 179 |
# File 'lib/async/container/thread.rb', line 177 def success? @error.nil? end |
#to_s ⇒ Object
A human readable representation of the status.
182 183 184 |
# File 'lib/async/container/thread.rb', line 182 def to_s "\#<#{self.class} #{success? ? "success" : "failure"}>" end |