Class: VisualizeRuby::Graphviz
- Inherits:
-
Object
- Object
- VisualizeRuby::Graphviz
- Defined in:
- lib/visualize_ruby/graphviz.rb
Instance Attribute Summary collapse
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(graphs, label: nil) ⇒ Graphviz
constructor
A new instance of Graphviz.
- #to_graph(type: :digraph, **output) ⇒ Object
Constructor Details
#initialize(graphs, label: nil) ⇒ Graphviz
Returns a new instance of Graphviz.
7 8 9 10 |
# File 'lib/visualize_ruby/graphviz.rb', line 7 def initialize(graphs, label: nil) @graphs = [*graphs] @label = label end |
Instance Attribute Details
#graphs ⇒ Object (readonly)
Returns the value of attribute graphs.
5 6 7 |
# File 'lib/visualize_ruby/graphviz.rb', line 5 def graphs @graphs end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/visualize_ruby/graphviz.rb', line 5 def label @label end |
Instance Method Details
#to_graph(type: :digraph, **output) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/visualize_ruby/graphviz.rb', line 12 def to_graph(type: :digraph, **output) g = main_graph(type) sub_graphs = sub_graphs(g) create_edges(sub_graphs) g.output(output) end |