Class: Crokus::Body
Overview
.….….….….….….….….…..
Instance Attribute Summary collapse
-
#stmts ⇒ Object
Returns the value of attribute stmts.
Instance Method Summary collapse
- #<<(e) ⇒ Object
- #collect(&block) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(stmts = []) ⇒ Body
constructor
A new instance of Body.
- #select(&block) ⇒ Object
- #size ⇒ Object
Methods inherited from Ast
Constructor Details
#initialize(stmts = []) ⇒ Body
Returns a new instance of Body.
166 167 168 |
# File 'lib/crokus/ast.rb', line 166 def initialize stmts=[] @stmts=stmts end |
Instance Attribute Details
#stmts ⇒ Object
Returns the value of attribute stmts.
165 166 167 |
# File 'lib/crokus/ast.rb', line 165 def stmts @stmts end |
Instance Method Details
#<<(e) ⇒ Object
170 171 172 173 |
# File 'lib/crokus/ast.rb', line 170 def <<(e) @stmts << e @stmts.flatten! end |
#collect(&block) ⇒ Object
179 180 181 |
# File 'lib/crokus/ast.rb', line 179 def collect(&block) @stmts.collect(&block) end |
#each(&block) ⇒ Object
175 176 177 |
# File 'lib/crokus/ast.rb', line 175 def each(&block) @stmts.each(&block) end |
#select(&block) ⇒ Object
183 184 185 |
# File 'lib/crokus/ast.rb', line 183 def select(&block) @stmts.select(&block) end |
#size ⇒ Object
187 188 189 |
# File 'lib/crokus/ast.rb', line 187 def size @stmts end |