Class: Rux::Visitor
- Inherits:
-
Object
- Object
- Rux::Visitor
- Defined in:
- lib/rux/visitor.rb
Direct Known Subclasses
Instance Method Summary collapse
- #visit(node) ⇒ Object
- #visit_children(node) ⇒ Object
- #visit_list(node) ⇒ Object
- #visit_ruby(node) ⇒ Object
- #visit_string(node) ⇒ Object
- #visit_tag(node) ⇒ Object
- #visit_text(node) ⇒ Object
Instance Method Details
#visit(node) ⇒ Object
3 4 5 |
# File 'lib/rux/visitor.rb', line 3 def visit(node) node.accept(self) end |
#visit_children(node) ⇒ Object
27 28 29 30 31 |
# File 'lib/rux/visitor.rb', line 27 def visit_children(node) if node.respond_to?(:children) node.children.each { |child| visit(child) } end end |
#visit_list(node) ⇒ Object
7 8 9 |
# File 'lib/rux/visitor.rb', line 7 def visit_list(node) visit_children(node) end |
#visit_ruby(node) ⇒ Object
11 12 13 |
# File 'lib/rux/visitor.rb', line 11 def visit_ruby(node) visit_children(node) end |
#visit_string(node) ⇒ Object
15 16 17 |
# File 'lib/rux/visitor.rb', line 15 def visit_string(node) visit_children(node) end |
#visit_tag(node) ⇒ Object
19 20 21 |
# File 'lib/rux/visitor.rb', line 19 def visit_tag(node) visit_children(node) end |
#visit_text(node) ⇒ Object
23 24 25 |
# File 'lib/rux/visitor.rb', line 23 def visit_text(node) visit_children(node) end |