Class: RubyRTL::If

Inherits:
Statement show all
Defined in:
lib/ruby_rtl/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Ast

#comments

Instance Method Summary collapse

Methods inherited from Ast

#accept

Constructor Details

#initialize(cond, body = nil) ⇒ If

Returns a new instance of If.



121
122
123
124
125
# File 'lib/ruby_rtl/ast.rb', line 121

def initialize cond, body=nil
  @cond=cond
  @body=body
  @elsifs=[]
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



118
119
120
# File 'lib/ruby_rtl/ast.rb', line 118

def body
  @body
end

#condObject

Returns the value of attribute cond.



118
119
120
# File 'lib/ruby_rtl/ast.rb', line 118

def cond
  @cond
end

#elseObject

idem



120
121
122
# File 'lib/ruby_rtl/ast.rb', line 120

def else
  @else
end

#elsifsObject

feeded by ContextualAnalyzer



119
120
121
# File 'lib/ruby_rtl/ast.rb', line 119

def elsifs
  @elsifs
end