Class: SyntaxTree::JSONVisitor
- Inherits:
-
FieldVisitor
- Object
- BasicVisitor
- FieldVisitor
- SyntaxTree::JSONVisitor
- Defined in:
- lib/syntax_tree/json_visitor.rb
Overview
This visitor transforms the AST into a hash that contains only primitives that can be easily serialized into JSON.
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize ⇒ JSONVisitor
constructor
A new instance of JSONVisitor.
Methods inherited from BasicVisitor
valid_visit_methods, #visit, #visit_all, #visit_child_nodes, visit_method, visit_methods
Constructor Details
#initialize ⇒ JSONVisitor
Returns a new instance of JSONVisitor.
11 12 13 |
# File 'lib/syntax_tree/json_visitor.rb', line 11 def initialize @target = nil end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/syntax_tree/json_visitor.rb', line 9 def target @target end |