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.


197
198
199
200
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 197

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

Instance Method Details

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


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

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