Class: Warg::Executor::Result
- Inherits:
-
Object
- Object
- Warg::Executor::Result
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/warg.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #successful? ⇒ Boolean
- #update(outcome) ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
1619 1620 1621 1622 1623 |
# File 'lib/warg.rb', line 1619 def initialize @mutex = Mutex.new @successful = true @value = [] end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
1617 1618 1619 |
# File 'lib/warg.rb', line 1617 def value @value end |
Instance Method Details
#failed? ⇒ Boolean
1638 1639 1640 1641 1642 |
# File 'lib/warg.rb', line 1638 def failed? @mutex.synchronize do not @successful end end |
#successful? ⇒ Boolean
1632 1633 1634 1635 1636 |
# File 'lib/warg.rb', line 1632 def successful? @mutex.synchronize do @successful end end |
#update(outcome) ⇒ Object
1625 1626 1627 1628 1629 1630 |
# File 'lib/warg.rb', line 1625 def update(outcome) @mutex.synchronize do @value << outcome @successful &&= outcome.successful? end end |