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.



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

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

Instance Attribute Details

#valueObject (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

Returns:

  • (Boolean)


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

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

#successful?Boolean

Returns:

  • (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