Class: Crokus::Body

Inherits:
Ast
  • Object
show all
Defined in:
lib/crokus/ast.rb

Overview

.….….….….….….….….…..

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ast

#accept, #str

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

#stmtsObject

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

#sizeObject



191
192
193
# File 'lib/crokus/ast.rb', line 191

def size
  @stmts
end