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

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

Overview

:nodoc:

Constant Summary

Constants inherited from FunctionalVisitor

FunctionalVisitor::DISPATCH_CACHE

Instance Method Summary collapse

Methods inherited from FunctionalVisitor

#visit, #visit_DOT, #visit_LITERAL, #visit_SLASH, #visit_SYMBOL

Constructor Details

#initializeDot

Returns a new instance of Dot.



195
196
197
198
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 195

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

Instance Method Details

#accept(node, seed = [[], []]) ⇒ Object



200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 200

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