Class: XRay::JS::ConditionExpression

Inherits:
Expression 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 Expression

#left_hand=, #left_hand?

Methods inherited from Element

#contains?, #position

Constructor Details

#initialize(condition, left, right) ⇒ ConditionExpression

Returns a new instance of ConditionExpression.



225
226
227
228
# File 'lib/js/struct.rb', line 225

def initialize(condition, left, right)
  super '?:', left, right, condition.position
  @condition = condition
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



223
224
225
# File 'lib/js/struct.rb', line 223

def condition
  @condition
end

Instance Method Details

#textObject



230
231
232
# File 'lib/js/struct.rb', line 230

def text
  "(#{type},#{condition},#{left},#{right})"
end