Class: DebugGraph
- Inherits:
-
Object
- Object
- DebugGraph
- Defined in:
- lib/debug_graph.rb
Instance Method Summary collapse
- #add_edge(from, to, opts) ⇒ Object
- #add_node(name, opts) ⇒ Object
- #filter(source, destination) ⇒ Object
-
#initialize(config) ⇒ DebugGraph
constructor
A new instance of DebugGraph.
- #output(renderer) ⇒ Object
Constructor Details
#initialize(config) ⇒ DebugGraph
Returns a new instance of DebugGraph.
5 6 7 |
# File 'lib/debug_graph.rb', line 5 def initialize(config) @g = Graph.new(config) end |
Instance Method Details
#add_edge(from, to, opts) ⇒ Object
13 14 15 |
# File 'lib/debug_graph.rb', line 13 def add_edge(from, to, opts) @g.add_edge(h(from), h(to), opts.update(label: h(opts[:label]))) end |
#add_node(name, opts) ⇒ Object
9 10 11 |
# File 'lib/debug_graph.rb', line 9 def add_node(name, opts) @g.add_node(h(name), opts) if name end |
#filter(source, destination) ⇒ Object
17 18 19 |
# File 'lib/debug_graph.rb', line 17 def filter(source, destination) @g.filter(source, destination) end |
#output(renderer) ⇒ Object
21 22 23 |
# File 'lib/debug_graph.rb', line 21 def output(renderer) @g.output(renderer) end |