Class: Omnium::Parser::AST::Compound
- Defined in:
- lib/omnium/parser/ast/compound.rb
Overview
This compound statement is for a ‘begin … end’ block and therefore represents a list of statement nodes as @children.
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
- #append(nodes) ⇒ Object
-
#initialize ⇒ Compound
constructor
A new instance of Compound.
Constructor Details
#initialize ⇒ Compound
Returns a new instance of Compound.
11 12 13 |
# File 'lib/omnium/parser/ast/compound.rb', line 11 def initialize @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
9 10 11 |
# File 'lib/omnium/parser/ast/compound.rb', line 9 def children @children end |
Instance Method Details
#append(nodes) ⇒ Object
15 16 17 18 |
# File 'lib/omnium/parser/ast/compound.rb', line 15 def append(nodes) nodes.each { |node| @children << node } self end |