Class: Pacer::Pipes::WrappingPipe

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

Instance Attribute Summary collapse

Attributes inherited from RubyPipe

#starts

Instance Method Summary collapse

Methods inherited from RubyPipe

#enablePath, #reset, #setStarts

Constructor Details

#initialize(graph, element_type = nil, extensions = []) ⇒ WrappingPipe

Returns a new instance of WrappingPipe.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 6

def initialize(graph, element_type = nil, extensions = [])
  super()
  if graph.is_a? Array
    @graph, @wrapper = graph
  else
    @graph = graph
    @element_type = element_type
    @extensions = extensions || []
    @wrapper = Pacer::Wrappers::WrapperSelector.build graph, element_type, @extensions
  end
end

Instance Attribute Details

#element_typeObject (readonly)

Returns the value of attribute element_type.



4
5
6
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 4

def element_type
  @element_type
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



4
5
6
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 4

def extensions
  @extensions
end

#graphObject (readonly)

Returns the value of attribute graph.



4
5
6
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 4

def graph
  @graph
end

#wrapperObject

Returns the value of attribute wrapper.



4
5
6
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 4

def wrapper
  @wrapper
end

Instance Method Details

#getCurrentPathObject



29
30
31
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 29

def getCurrentPath
  starts.getCurrentPath
end

#getSideEffectObject



25
26
27
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 25

def getSideEffect
  starts.getSideEffect
end

#instance(pipe, g) ⇒ Object



18
19
20
21
22
23
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 18

def instance(pipe, g)
  g ||= graph
  p = WrappingPipe.new [g, wrapper]
  p.setStarts pipe
  p
end

#processNextStartObject



41
42
43
# File 'lib/pacer/pipe/wrapping_pipe.rb', line 41

def processNextStart
  wrapper.new graph, starts.next
end