Class: Tap::Support::Joins::Sequence

Inherits:
Tap::Support::Join show all
Defined in:
lib/tap/support/joins/sequence.rb

Overview

A Sequence join simply pass results from one task to the next.

Constant Summary

Constants inherited from Tap::Support::Join

Tap::Support::Join::FLAGS, Tap::Support::Join::SHORT_FLAGS

Instance Method Summary collapse

Methods inherited from Tap::Support::Join

#initialize, #inspect, join, #name, #options

Constructor Details

This class inherits a constructor from Tap::Support::Join

Instance Method Details

#join(source, targets) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/tap/support/joins/sequence.rb', line 7

def join(source, targets)
  current_task = source
  targets.each do |next_task|
    complete(current_task) do |_result| 
      yield(_result) if block_given?
      enq(next_task, _result)
    end
    current_task = next_task
  end
end