Class: Gandiva::ExpressionBuilder::If
- Inherits:
-
Object
- Object
- Gandiva::ExpressionBuilder::If
- Defined in:
- lib/gandiva/expression-builder/if.rb
Direct Known Subclasses
Instance Method Summary collapse
- #build ⇒ Object
- #else(clause) ⇒ Object
- #elsif(condition) ⇒ Object
-
#initialize(condition) ⇒ If
constructor
A new instance of If.
- #then(clause) ⇒ Object
Constructor Details
#initialize(condition) ⇒ If
Returns a new instance of If.
21 22 23 24 25 |
# File 'lib/gandiva/expression-builder/if.rb', line 21 def initialize(condition) @condition = condition @then = nil @else = nil end |
Instance Method Details
#build ⇒ Object
41 42 43 44 45 |
# File 'lib/gandiva/expression-builder/if.rb', line 41 def build build_if_node(condition_node, then_node, else_node) end |
#else(clause) ⇒ Object
32 33 34 35 |
# File 'lib/gandiva/expression-builder/if.rb', line 32 def else(clause) @else = clause self end |
#elsif(condition) ⇒ Object
37 38 39 |
# File 'lib/gandiva/expression-builder/if.rb', line 37 def elsif(condition) Elsif.new(self, condition) end |
#then(clause) ⇒ Object
27 28 29 30 |
# File 'lib/gandiva/expression-builder/if.rb', line 27 def then(clause) @then = clause self end |