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.
1750 1751 1752 1753 1754 |
# File 'lib/warg.rb', line 1750 def initialize @mutex = Mutex.new @successful = true @value = [] end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
1748 1749 1750 |
# File 'lib/warg.rb', line 1748 def value @value end |
Instance Method Details
#failed? ⇒ Boolean
1769 1770 1771 1772 1773 |
# File 'lib/warg.rb', line 1769 def failed? @mutex.synchronize do not @successful end end |
#successful? ⇒ Boolean
1763 1764 1765 1766 1767 |
# File 'lib/warg.rb', line 1763 def successful? @mutex.synchronize do @successful end end |
#update(outcome) ⇒ Object
1756 1757 1758 1759 1760 1761 |
# File 'lib/warg.rb', line 1756 def update(outcome) @mutex.synchronize do @value << outcome @successful &&= outcome.successful? end end |