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.



166
167
168
# File 'lib/crokus/ast.rb', line 166

def initialize stmts=[]
  @stmts=stmts
end

Instance Attribute Details

#stmtsObject

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

#sizeObject



187
188
189
# File 'lib/crokus/ast.rb', line 187

def size
  @stmts
end