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.
170 171 172 |
# File 'lib/crokus/ast.rb', line 170 def initialize stmts=[] @stmts=stmts end |
Instance Attribute Details
#stmts ⇒ Object
Returns the value of attribute stmts.
169 170 171 |
# File 'lib/crokus/ast.rb', line 169 def stmts @stmts end |
Instance Method Details
#<<(e) ⇒ Object
174 175 176 177 |
# File 'lib/crokus/ast.rb', line 174 def <<(e) @stmts << e @stmts.flatten! end |
#collect(&block) ⇒ Object
183 184 185 |
# File 'lib/crokus/ast.rb', line 183 def collect(&block) @stmts.collect(&block) end |
#each(&block) ⇒ Object
179 180 181 |
# File 'lib/crokus/ast.rb', line 179 def each(&block) @stmts.each(&block) end |
#select(&block) ⇒ Object
187 188 189 |
# File 'lib/crokus/ast.rb', line 187 def select(&block) @stmts.select(&block) end |
#size ⇒ Object
191 192 193 |
# File 'lib/crokus/ast.rb', line 191 def size @stmts end |