Class: Frill::DependencyGraph::CycleDetecter
- Inherits:
-
Object
- Object
- Frill::DependencyGraph::CycleDetecter
- Defined in:
- lib/frill/frill.rb
Class Method Summary collapse
Instance Method Summary collapse
- #detect! ⇒ Object
-
#initialize(nodes) ⇒ CycleDetecter
constructor
A new instance of CycleDetecter.
Constructor Details
#initialize(nodes) ⇒ CycleDetecter
Returns a new instance of CycleDetecter.
111 112 113 114 |
# File 'lib/frill/frill.rb', line 111 def initialize nodes @nodes = nodes @visited = {} end |
Class Method Details
.detect!(nodes) ⇒ Object
107 108 109 |
# File 'lib/frill/frill.rb', line 107 def self.detect! nodes new(nodes).detect! end |
Instance Method Details
#detect! ⇒ Object
116 117 118 119 120 |
# File 'lib/frill/frill.rb', line 116 def detect! nodes.values.each do |node| fan_out node unless visited[node.label] end end |