Class: Gandiva::ExpressionBuilder::If

Inherits:
Object
  • Object
show all
Defined in:
lib/gandiva/expression-builder/if.rb

Direct Known Subclasses

Elsif

Instance Method Summary collapse

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

#buildObject



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