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.
1709 1710 1711 1712 1713 |
# File 'lib/warg.rb', line 1709 def initialize @mutex = Mutex.new @successful = true @value = [] end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
1707 1708 1709 |
# File 'lib/warg.rb', line 1707 def value @value end |
Instance Method Details
#failed? ⇒ Boolean
1728 1729 1730 1731 1732 |
# File 'lib/warg.rb', line 1728 def failed? @mutex.synchronize do not @successful end end |
#successful? ⇒ Boolean
1722 1723 1724 1725 1726 |
# File 'lib/warg.rb', line 1722 def successful? @mutex.synchronize do @successful end end |
#update(outcome) ⇒ Object
1715 1716 1717 1718 1719 1720 |
# File 'lib/warg.rb', line 1715 def update(outcome) @mutex.synchronize do @value << outcome @successful &&= outcome.successful? end end |