Class: Usher::Util::Graph

Inherits:
Object
  • Object
show all
Defined in:
lib/usher/util/graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(router) ⇒ Graph

Returns a new instance of Graph.



7
8
9
# File 'lib/usher/util/graph.rb', line 7

def initialize(router)
  @router = router
end

Instance Attribute Details

#routerObject (readonly)

Returns the value of attribute router.



5
6
7
# File 'lib/usher/util/graph.rb', line 5

def router
  @router
end

Instance Method Details

#draw(output) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/usher/util/graph.rb', line 11

def draw(output)
  File.open(output, 'w') do |f|
    f.puts "digraph {"
    f.puts %|node[label="node"]|
    f.puts "}"
  end
end