Class: XRay::JS::IfStatement

Inherits:
Statement show all
Defined in:
lib/js/struct.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#left, #right, #type

Instance Method Summary collapse

Methods inherited from Statement

#end_with_semicolon=, #end_with_semicolon?

Methods inherited from Element

#contains?, #position, #text

Constructor Details

#initialize(condition, true_part, false_part, position) ⇒ IfStatement

Returns a new instance of IfStatement.



113
114
115
116
# File 'lib/js/struct.rb', line 113

def initialize(condition, true_part, false_part, position)
  super 'if', condition, true_part, position
  @false_part = false_part
end

Instance Attribute Details

#false_partObject (readonly)

Returns the value of attribute false_part.



109
110
111
# File 'lib/js/struct.rb', line 109

def false_part
  @false_part
end