Class: RubyRTL::Body
- Includes:
- Enumerable
- Defined in:
- lib/ruby_rtl/ast.rb
Overview
statements ===
Instance Attribute Summary collapse
-
#stmts ⇒ Object
Returns the value of attribute stmts.
Attributes inherited from Ast
Instance Method Summary collapse
- #<<(e) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(stmts = []) ⇒ Body
constructor
A new instance of Body.
Methods inherited from Ast
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
#stmts ⇒ Object
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 |