Class: CrossSpec::SpecWaiting
- Inherits:
-
Object
- Object
- CrossSpec::SpecWaiting
- Defined in:
- lib/cross_spec/spec.rb
Instance Method Summary collapse
- #data ⇒ Object
- #done? ⇒ Boolean
-
#initialize(tasks) ⇒ SpecWaiting
constructor
A new instance of SpecWaiting.
- #process(message, &block) ⇒ Object
Constructor Details
#initialize(tasks) ⇒ SpecWaiting
Returns a new instance of SpecWaiting.
3 4 5 6 7 |
# File 'lib/cross_spec/spec.rb', line 3 def initialize(tasks) @positive_matches = 0 @data = [] @tasks = Array(tasks) end |
Instance Method Details
#data ⇒ Object
31 32 33 |
# File 'lib/cross_spec/spec.rb', line 31 def data @data end |
#done? ⇒ Boolean
27 28 29 |
# File 'lib/cross_spec/spec.rb', line 27 def done? @positive_matches === @tasks.length end |
#process(message, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cross_spec/spec.rb', line 9 def process(, &block) return unless .is_a?(TaskMessage) return unless @tasks.include?(.task) positive_match = if block yield .data, .biomarkers elsif DistributedTracing.get.any? (.biomarkers & DistributedTracing.get).any? else false end if positive_match increment_matches store_data() end end |