Class: Turbine::Pipeline::Traverse
- Includes:
- Turbine::Pipeline::Trace::Untraceable
- Defined in:
- lib/turbine/pipeline/traversal.rb
Instance Attribute Summary
Attributes inherited from Segment
Instance Method Summary collapse
-
#initialize(direction, label = nil, klass = nil) ⇒ Traverse
constructor
Public: Creates a new Traverse segment.
Methods included from Turbine::Pipeline::Trace::Untraceable
Methods inherited from Expander
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 |