Module: RGL::GraphIterator
- Includes:
- GraphWrapper, Stream
- Included in:
- BFSIterator, TopsortIterator
- Defined in:
- lib/rgl/graph_iterator.rb
Overview
A GraphIterator is the abstract basis for all Iterators on graphs. Each graph iterator should implement the protocol defined in module Stream.
Instance Attribute Summary collapse
-
#graph ⇒ Graph
included
from GraphWrapper
The wrapped graph.
Instance Method Summary collapse
-
#initialize(graph) ⇒ Object
included
from GraphWrapper
Creates a new GraphWrapper on graph.
- #length ⇒ int
Instance Attribute Details
#graph ⇒ Graph Originally defined in module GraphWrapper
Returns the wrapped graph.
Instance Method Details
#initialize(graph) ⇒ Object Originally defined in module GraphWrapper
Creates a new GraphWrapper on graph.
#length ⇒ int
16 17 18 |
# File 'lib/rgl/graph_iterator.rb', line 16 def length inject(0) { |sum| sum + 1 } end |