Class: CycleDetector::DOTPrintStrategy

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

Instance Method Summary collapse

Constructor Details

#initializeDOTPrintStrategy

Returns a new instance of DOTPrintStrategy.



278
279
280
# File 'lib/kwala/lib/cycle_detector.rb', line 278

def initialize
  @visited = Hash.new(false)
end

Instance Method Details



292
293
294
295
296
297
298
299
300
301
302
# File 'lib/kwala/lib/cycle_detector.rb', line 292

def print_cycles(cycles)
  print_dot_wrapper do
    if cycles.size > 0

      cycles.each do |path|
        print_cycle_path(path)
      end

    end
  end
end


282
283
284
285
286
287
288
289
290
# File 'lib/kwala/lib/cycle_detector.rb', line 282

def print_graph(graph)
  print_dot_wrapper do
    print_sub_clusers(graph.keys)

    graph.sort.each do |k, v|
      print_node(v)
    end
  end
end