Class: Groonga::ExpressionBuildable::BinaryExpressionBuilder

Inherits:
ExpressionBuilder show all
Defined in:
lib/groonga/expression-builder.rb

Instance Method Summary collapse

Methods inherited from ExpressionBuilder

#&, #-, #|

Constructor Details

#initialize(operation, column_value_builder, value) ⇒ BinaryExpressionBuilder

Returns a new instance of BinaryExpressionBuilder.



343
344
345
346
347
348
# File 'lib/groonga/expression-builder.rb', line 343

def initialize(operation, column_value_builder, value)
  super()
  @operation = operation
  @column_value_builder = column_value_builder
  @value = value
end

Instance Method Details

#build(expression, variable) ⇒ Object



350
351
352
353
354
# File 'lib/groonga/expression-builder.rb', line 350

def build(expression, variable)
  @column_value_builder.build(expression, variable)
  expression.append_constant(@value)
  expression.append_operation(@operation, 2)
end