Class: ActionDispatch::Journey::Visitors::Dot

Inherits:
Visitor show all
Defined in:
actionpack/lib/action_dispatch/journey/visitors.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Visitor

Visitor::DISPATCH_CACHE

Instance Method Summary collapse

Constructor Details

#initializeDot

Returns a new instance of Dot.



130
131
132
133
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 130

def initialize
  @nodes = []
  @edges = []
end

Instance Method Details

#accept(node) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 135

def accept(node)
  super
  <<-eodot
  digraph parse_tree {
    size="8,5"
    node [shape = none];
    edge [dir = none];
    #{@nodes.join "\n"}
    #{@edges.join("\n")}
  }
  eodot
end