Class: Predicator::Visitors::Dot
- Defined in:
- lib/predicator/visitors/dot.rb
Constant Summary
Constants inherited from Visitor
Instance Attribute Summary collapse
-
#edges ⇒ Object
readonly
Returns the value of attribute edges.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #accept(node) ⇒ Object
-
#initialize ⇒ Dot
constructor
A new instance of Dot.
Constructor Details
#initialize ⇒ Dot
Returns a new instance of Dot.
6 7 8 9 |
# File 'lib/predicator/visitors/dot.rb', line 6 def initialize @nodes = [] @edges = [] end |
Instance Attribute Details
#edges ⇒ Object (readonly)
Returns the value of attribute edges.
4 5 6 |
# File 'lib/predicator/visitors/dot.rb', line 4 def edges @edges end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
4 5 6 |
# File 'lib/predicator/visitors/dot.rb', line 4 def nodes @nodes end |
Instance Method Details
#accept(node) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/predicator/visitors/dot.rb', line 11 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 |