Class: BoPeep::Executor::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



1834
1835
1836
1837
1838
# File 'lib/bopeep.rb', line 1834

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



1832
1833
1834
# File 'lib/bopeep.rb', line 1832

def value
  @value
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


1853
1854
1855
1856
1857
# File 'lib/bopeep.rb', line 1853

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

#successful?Boolean

Returns:

  • (Boolean)


1847
1848
1849
1850
1851
# File 'lib/bopeep.rb', line 1847

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

#update(outcome) ⇒ Object



1840
1841
1842
1843
1844
1845
# File 'lib/bopeep.rb', line 1840

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