Class: Crokus::If

Inherits:
CtrlStmt show all
Defined in:
lib/crokus/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ast

#accept, #str

Constructor Details

#initialize(cond, body, else_ = nil) ⇒ If

Returns a new instance of If.



290
291
292
# File 'lib/crokus/ast.rb', line 290

def initialize cond,body,else_=nil
  @cond,@body,@else=cond,body,else_
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



289
290
291
# File 'lib/crokus/ast.rb', line 289

def body
  @body
end

#condObject

Returns the value of attribute cond.



289
290
291
# File 'lib/crokus/ast.rb', line 289

def cond
  @cond
end

#elseObject

Returns the value of attribute else.



289
290
291
# File 'lib/crokus/ast.rb', line 289

def else
  @else
end