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

Inherits:
FunctionalVisitor show all
Defined in:
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 '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 'lib/action_dispatch/journey/visitors.rb', line 202

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