brew/Library/Homebrew/cask/lib/hbc/topological_hash.rb
2016-09-24 16:00:58 +02:00

15 lines
243 B
Ruby

require "tsort"
# a basic topologically sortable hashmap
module Hbc
class TopologicalHash < Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
end