Class: GraphvizR::NodeGroup
- Inherits:
-
Object
- Object
- GraphvizR::NodeGroup
- Defined in:
- lib/graphviz_r.rb
Overview
this represent a group of nodes
Instance Method Summary collapse
-
#initialize(nodes, opts) ⇒ NodeGroup
constructor
A new instance of NodeGroup.
- #to_dot(indent) ⇒ Object
Constructor Details
#initialize(nodes, opts) ⇒ NodeGroup
Returns a new instance of NodeGroup.
347 348 349 350 |
# File 'lib/graphviz_r.rb', line 347 def initialize(nodes, opts) @nodes = nodes @opts = opts end |
Instance Method Details
#to_dot(indent) ⇒ Object
352 353 354 355 356 |
# File 'lib/graphviz_r.rb', line 352 def to_dot(indent) = @opts.to_a.map{|e| "#{e[0]} = #{e[1]};"}.join ' ' nodes = @nodes.map{|e| "#{e.to_s};"}.join ' ' "#{INDENT_UNIT * indent}{#{} #{nodes}};\n" end |