Class: ORB::AST::AbstractNode
- Inherits:
-
Object
- Object
- ORB::AST::AbstractNode
- Defined in:
- lib/orb/ast/abstract_node.rb
Direct Known Subclasses
BlockNode, ControlExpressionNode, NewlineNode, PrintingExpressionNode, PrivateCommentNode, PublicCommentNode, RootNode, TagNode, TextNode
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#children ⇒ Object
Returns the value of attribute children.
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add_child(node) ⇒ Object
-
#initialize(*_args) ⇒ AbstractNode
constructor
A new instance of AbstractNode.
- #render(_context) ⇒ Object
Constructor Details
#initialize(*_args) ⇒ AbstractNode
Returns a new instance of AbstractNode.
8 9 10 11 |
# File 'lib/orb/ast/abstract_node.rb', line 8 def initialize(*_args) @children = [] @errors = [] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/orb/ast/abstract_node.rb', line 6 def attributes @attributes end |
#children ⇒ Object
Returns the value of attribute children.
6 7 8 |
# File 'lib/orb/ast/abstract_node.rb', line 6 def children @children end |
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/orb/ast/abstract_node.rb', line 6 def errors @errors end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 |
# File 'lib/orb/ast/abstract_node.rb', line 21 def ==(other) self.class == other.class && @children == other.children end |
#add_child(node) ⇒ Object
13 14 15 |
# File 'lib/orb/ast/abstract_node.rb', line 13 def add_child(node) @children << node end |
#render(_context) ⇒ Object
17 18 19 |
# File 'lib/orb/ast/abstract_node.rb', line 17 def render(_context) raise "Not implemented - you must implement render in your subclass!" end |