Parent

Files

Class/Module Index [+]

Quicksearch

DiagramGraph

RailRoad diagram structure

Public Class Methods

new() click to toggle source
# File lib/railroad/diagram_graph.rb, line 11
def initialize
  @diagram_type = ''
  @show_label = false
  @nodes = []
  @edges = []
end

Public Instance Methods

add_edge(edge) click to toggle source
# File lib/railroad/diagram_graph.rb, line 22
def add_edge(edge)
  @edges << edge
end
add_node(node) click to toggle source
# File lib/railroad/diagram_graph.rb, line 18
def add_node(node)
  @nodes << node
end
diagram_type=(type) click to toggle source
# File lib/railroad/diagram_graph.rb, line 26
def diagram_type= (type)
  @diagram_type = type
end
show_label=(value) click to toggle source
# File lib/railroad/diagram_graph.rb, line 30
def show_label= (value)
  @show_label = value
end
to_dot() click to toggle source

Generate DOT graph

# File lib/railroad/diagram_graph.rb, line 36
def to_dot
  return dot_header +
         @nodes.map{|n| dot_node n[0], n[1], n[2]}.join +
         @edges.map{|e| dot_edge e[0], e[1], e[2], e[3]}.join +
         dot_footer
end
to_xmi() click to toggle source

Generate XMI diagram (not yet implemented)

# File lib/railroad/diagram_graph.rb, line 44
def to_xmi
   STDERR.print "Sorry. XMI output not yet implemented.\n\n"
   return ""
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.