Class: Pacer::Pipes::UnaryTransformPipe

Inherits:
RubyPipe
  • Object
show all
Defined in:
lib/pacer/pipe/unary_transform_pipe.rb

Direct Known Subclasses

CrossProductTransformPipe

Instance Attribute Summary collapse

Attributes inherited from RubyPipe

#starts

Instance Method Summary collapse

Methods inherited from RubyPipe

#enablePath, #reset, #setStarts

Constructor Details

#initialize(method, branch_a) ⇒ UnaryTransformPipe

Returns a new instance of UnaryTransformPipe.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pacer/pipe/unary_transform_pipe.rb', line 8

def initialize(method, branch_a)
  super()
  if branch_a.is_a? Pipe
    @branch_a = branch_a
    @a = nil
  else
    @a = branch_a
  end
  @first = true
  @method = method
  @element = nil
end

Instance Attribute Details

#branch_aObject (readonly)

Returns the value of attribute branch_a.



6
7
8
# File 'lib/pacer/pipe/unary_transform_pipe.rb', line 6

def branch_a
  @branch_a
end

#methodObject (readonly)

Returns the value of attribute method.



6
7
8
# File 'lib/pacer/pipe/unary_transform_pipe.rb', line 6

def method
  @method
end

Instance Method Details

#processNextStartObject



21
22
23
24
# File 'lib/pacer/pipe/unary_transform_pipe.rb', line 21

def processNextStart
  next_a
  a.send method rescue nil if a.respond_to? method
end