class CooCoo::Dot::Graph

Attributes

blocks[R]
edges[R]
nodes[R]

Public Class Methods

new(kind, options) { |self| ... } click to toggle source
Calls superclass method CooCoo::Dot::Block::new
# File lib/coo-coo/dot.rb, line 41
def initialize(kind, options)
  super(kind, options)
  @nodes = []
  @edges = []
  @blocks = []
  yield(self) if block_given?
end

Public Instance Methods

add_block(type, options = {}, &block) click to toggle source
# File lib/coo-coo/dot.rb, line 64
def add_block(type, options = {}, &block)
  @blocks << Graph.new(type, options, &block)
  self
end
add_edge(nodes, options = {}) click to toggle source
# File lib/coo-coo/dot.rb, line 54
def add_edge(nodes, options = {})
  @edges << Edge.new(nodes, options)
  self
end
add_node(name, options = {}) click to toggle source
# File lib/coo-coo/dot.rb, line 49
def add_node(name, options = {})
  @nodes << Node.new(name, options)
  self
end
add_subgraph(name, options = {}, &block) click to toggle source
# File lib/coo-coo/dot.rb, line 59
def add_subgraph(name, options = {}, &block)
  @blocks << Graph.new("subgraph #{name}", options, &block)
  self
end