Class: Warg::Executor::Result

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/warg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



1751
1752
1753
1754
1755
# File 'lib/warg.rb', line 1751

def initialize
  @mutex = Mutex.new
  @successful = true
  @value = []
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



1749
1750
1751
# File 'lib/warg.rb', line 1749

def value
  @value
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


1770
1771
1772
1773
1774
# File 'lib/warg.rb', line 1770

def failed?
  @mutex.synchronize do
    not @successful
  end
end

#successful?Boolean

Returns:

  • (Boolean)


1764
1765
1766
1767
1768
# File 'lib/warg.rb', line 1764

def successful?
  @mutex.synchronize do
    @successful
  end
end

#update(outcome) ⇒ Object



1757
1758
1759
1760
1761
1762
# File 'lib/warg.rb', line 1757

def update(outcome)
  @mutex.synchronize do
    @value << outcome
    @successful &&= outcome.successful?
  end
end