Class: Chef::Tsorter

Inherits:
Object
  • Object
show all
Includes:
TSort
Defined in:
lib/chef/tsorter.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Tsorter

Returns a new instance of Tsorter.


8
9
10
# File 'lib/chef/tsorter.rb', line 8

def initialize(data)
  @data = data
end

Instance Method Details

#tsort_each_child(node, &block) ⇒ Object


16
17
18
# File 'lib/chef/tsorter.rb', line 16

def tsort_each_child(node, &block)
  @data.fetch(node).each(&block)
end

#tsort_each_node(&block) ⇒ Object


12
13
14
# File 'lib/chef/tsorter.rb', line 12

def tsort_each_node(&block)
  @data.each_key(&block)
end