Class: Ocelot::Graph::Traverser

Inherits:
Object
  • Object
show all
Defined in:
lib/ocelot/graph.rb

Class Method Summary collapse

Class Method Details

.run(queue) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/ocelot/graph.rb', line 4

def self.run(queue)
  while !queue.empty?
    snapshot, queue = queue.uniq, []
    snapshot.each do |node|
      yield node, queue
    end
  end
end