Class: RubyRTL::Body

Inherits:
Ast
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ruby_rtl/ast.rb

Overview

statements ===

Instance Attribute Summary collapse

Attributes inherited from Ast

#comments

Instance Method Summary collapse

Methods inherited from Ast

#accept

Constructor Details

#initialize(stmts = []) ⇒ Body



93
94
95
# File 'lib/ruby_rtl/ast.rb', line 93

def initialize stmts=[]
  @stmts=stmts
end

Instance Attribute Details

#stmtsObject

Returns the value of attribute stmts.



92
93
94
# File 'lib/ruby_rtl/ast.rb', line 92

def stmts
  @stmts
end

Instance Method Details

#<<(e) ⇒ Object



97
98
99
100
# File 'lib/ruby_rtl/ast.rb', line 97

def <<(e)
  @stmts << e
  @stmts.flatten!
end

#each(&block) ⇒ Object



102
103
104
# File 'lib/ruby_rtl/ast.rb', line 102

def each &block
  stmts.each(&block)
end