Sha256: 34cdb268987f9ff6b7932656f7684d0fe5cc52573c5a44fdd929a55a381b8e69

Contents?: true

Size: 424 Bytes

Versions: 8

Compression:

Stored size: 424 Bytes

Contents

require 'stream'

require 'rgl/graph_wrapper'

module RGL

  # A GraphIterator is the abstract basis for all Iterators on graphs.
  # Each graph iterator should implement the protocol defined in module
  # {https://rubydoc.info/github/monora/stream Stream}.
  #
  module GraphIterator
    include Stream
    include GraphWrapper

    # @return [int]
    def length
      inject(0) { |sum| sum + 1 }
    end
  end

end # RGL

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rgl-0.6.6 lib/rgl/graph_iterator.rb
rgl-0.6.5 lib/rgl/graph_iterator.rb
rgl-0.6.4 lib/rgl/graph_iterator.rb
rgl-0.6.3 lib/rgl/graph_iterator.rb
rgl-0.6.2 lib/rgl/graph_iterator.rb
rgl-0.6.1 lib/rgl/graph_iterator.rb
rgl-0.6.0 lib/rgl/graph_iterator.rb
rgl-0.5.10 lib/rgl/graph_iterator.rb