Class: Pacer::Pipes::CrossProductTransformPipe

Inherits:
UnaryTransformPipe show all
Defined in:
lib/pacer/pipe/cross_product_transform_pipe.rb

Instance Attribute Summary collapse

Attributes inherited from UnaryTransformPipe

#branch_a, #method

Attributes inherited from RubyPipe

#starts

Instance Method Summary collapse

Methods inherited from RubyPipe

#enablePath, #reset, #setStarts

Constructor Details

#initialize(method, branch_a, branch_b) ⇒ CrossProductTransformPipe

Returns a new instance of CrossProductTransformPipe.



5
6
7
8
9
10
11
12
13
# File 'lib/pacer/pipe/cross_product_transform_pipe.rb', line 5

def initialize(method, branch_a, branch_b)
  super(method, branch_a)
  if branch_b.is_a? Pipe
    @branch_b = branch_b
    @b = nil
  else
    @b = branch_b
  end
end

Instance Attribute Details

#branch_bObject (readonly)

Returns the value of attribute branch_b.



3
4
5
# File 'lib/pacer/pipe/cross_product_transform_pipe.rb', line 3

def branch_b
  @branch_b
end

Instance Method Details

#processNextStartObject



15
16
17
18
# File 'lib/pacer/pipe/cross_product_transform_pipe.rb', line 15

def processNextStart
  next_pair
  a.send method, b rescue nil if a.respond_to? method
end