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.



1709
1710
1711
1712
1713
# File 'lib/warg.rb', line 1709

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

Instance Attribute Details

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

Returns:

  • (Boolean)


1728
1729
1730
1731
1732
# File 'lib/warg.rb', line 1728

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

#successful?Boolean

Returns:

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