Class: ClassDependencies::TSortHash
- Inherits:
-
Hash
- Object
- Hash
- ClassDependencies::TSortHash
- Includes:
- TSort
- Defined in:
- lib/class_dependencies.rb
Instance Method Summary collapse
-
#initialize(mod) ⇒ TSortHash
constructor
A new instance of TSortHash.
- #tsort_each_child(node, &block) ⇒ Object
- #tsort_each_node(&block) ⇒ Object
Constructor Details
#initialize(mod) ⇒ TSortHash
Returns a new instance of TSortHash.
43 44 45 |
# File 'lib/class_dependencies.rb', line 43 def initialize(mod) @mod = mod end |
Instance Method Details
#tsort_each_child(node, &block) ⇒ Object
49 50 51 |
# File 'lib/class_dependencies.rb', line 49 def tsort_each_child(node,&block) fetch(node,[]).each(&block) end |
#tsort_each_node(&block) ⇒ Object
46 47 48 |
# File 'lib/class_dependencies.rb', line 46 def tsort_each_node(&block) @mod.descendants.each(&block) end |