Class: Omnium::Parser::AST::Compound

Inherits:
Base
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeCompound

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

#childrenObject (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