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.
187 188 189 |
# File 'lib/async/container/thread.rb', line 187 def initialize(error = nil) @error = error end |
Instance Method Details
#success? ⇒ Boolean
Whether the status represents a successful outcome.
193 194 195 |
# File 'lib/async/container/thread.rb', line 193 def success? @error.nil? end |
#to_s ⇒ Object
A human readable representation of the status.
198 199 200 |
# File 'lib/async/container/thread.rb', line 198 def to_s "\#<#{self.class} #{success? ? "success" : "failure"}>" end |