Class: Deptree::Visitor
- Inherits:
-
Object
- Object
- Deptree::Visitor
- Defined in:
- lib/deptree/visitor.rb,
lib/deptree/visitor/kahn.rb
Defined Under Namespace
Classes: Kahn
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(roots) ⇒ Visitor
constructor
A new instance of Visitor.
- #visit(&block) ⇒ Object
Constructor Details
#initialize(roots) ⇒ Visitor
Returns a new instance of Visitor.
9 10 11 |
# File 'lib/deptree/visitor.rb', line 9 def initialize(roots) @roots = roots end |
Class Method Details
.each(roots, &block) ⇒ Object
5 6 7 |
# File 'lib/deptree/visitor.rb', line 5 def self.each(roots, &block) new(roots).visit(&block) end |
Instance Method Details
#visit(&block) ⇒ Object
13 14 15 |
# File 'lib/deptree/visitor.rb', line 13 def visit(&block) sorted.each(&block) end |