Class: Turbine::Pipeline::Traverse

Inherits:
Expander show all
Includes:
Turbine::Pipeline::Trace::Untraceable
Defined in:
lib/turbine/pipeline/traversal.rb

Instance Attribute Summary

Attributes inherited from Segment

#source

Instance Method Summary collapse

Methods included from Turbine::Pipeline::Trace::Untraceable

#tracing=

Methods inherited from Expander

#next

Methods inherited from Segment

#append, #each, #inspect, #next, #rewind, #to_s, #trace, #tracing=

Constructor Details

#initialize(direction, label = nil, klass = nil) ⇒ Traverse

Public: Creates a new Traverse segment. Uses one of the traversal classes to emit every descendant of the input node.

direction - The direction in which to traverse edges. :in or :out. label - An optional label by which to restrict the edges

traversed.

klass - The traversal strategy. Defaults to BreadthFirst.

Returns a new Traverse.



15
16
17
18
19
# File 'lib/turbine/pipeline/traversal.rb', line 15

def initialize(direction, label = nil, klass = nil)
  @direction = direction
  @label     = label
  @klass   ||= Traversal::BreadthFirst
end