Class: Rjq::AST::If
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#else_branch ⇒ Object
readonly
Returns the value of attribute else_branch.
-
#then_branch ⇒ Object
readonly
Returns the value of attribute then_branch.
Attributes inherited from Node
Instance Method Summary collapse
- #eval(input, context) ⇒ Object
-
#initialize(condition, then_branch, else_branch) ⇒ If
constructor
A new instance of If.
Methods inherited from Node
#assign_value, #invalid_path_message, #paths, #take, #with_source_span
Constructor Details
#initialize(condition, then_branch, else_branch) ⇒ If
Returns a new instance of If.
673 674 675 676 677 |
# File 'lib/rjq/ast.rb', line 673 def initialize(condition, then_branch, else_branch) @condition = condition @then_branch = then_branch @else_branch = else_branch end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
671 672 673 |
# File 'lib/rjq/ast.rb', line 671 def condition @condition end |
#else_branch ⇒ Object (readonly)
Returns the value of attribute else_branch.
671 672 673 |
# File 'lib/rjq/ast.rb', line 671 def else_branch @else_branch end |
#then_branch ⇒ Object (readonly)
Returns the value of attribute then_branch.
671 672 673 |
# File 'lib/rjq/ast.rb', line 671 def then_branch @then_branch end |