Class: Rigor::ModuleGraph::CycleDetector::Cycle

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/module_graph/cycle_detector.rb

Overview

One detected cycle, expressed as the list of node names along it. Always rotated so the lexicographically smallest name comes first, so the rendered output is stable across runs.

Instance Method Summary collapse

Instance Method Details

#to_sObject

Render the cycle as A -> B -> C -> A (note the closing repeat of the first node so the round-trip is obvious).



30
31
32
# File 'lib/rigor/module_graph/cycle_detector.rb', line 30

def to_s
  nodes.join(" -> ") + " -> " + nodes.first
end