Class: ImgToScript::AbstractToken::IfCondition

Inherits:
ImgToScript::AbstractToken show all
Defined in:
lib/img_to_script/abstract_token/if_condition.rb

Overview

If condition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression:, consequent:) ⇒ IfCondition

Returns a new instance of IfCondition.



11
12
13
14
15
16
17
# File 'lib/img_to_script/abstract_token/if_condition.rb', line 11

def initialize(expression:, consequent:, **)
  @type = AbsTokenType::IF_CONDITION
  @expression = expression
  @consequent = consequent

  super
end

Instance Attribute Details

#consequentObject (readonly)

Returns the value of attribute consequent.



9
10
11
# File 'lib/img_to_script/abstract_token/if_condition.rb', line 9

def consequent
  @consequent
end

#expressionObject (readonly)

Returns the value of attribute expression.



9
10
11
# File 'lib/img_to_script/abstract_token/if_condition.rb', line 9

def expression
  @expression
end