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

Inherits:
Visitor
  • Object
show all
Defined in:
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.


133
134
135
136
# File 'lib/action_dispatch/journey/visitors.rb', line 133

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

Instance Method Details

#accept(node) ⇒ Object


138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/action_dispatch/journey/visitors.rb', line 138

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