Class: Groonga::ExpressionBuildable::SetExpressionBuilder

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

Instance Method Summary collapse

Methods inherited from ExpressionBuilder

#&, #-, #|

Constructor Details

#initialize(operation, *expression_builders) ⇒ SetExpressionBuilder

Returns a new instance of SetExpressionBuilder.



116
117
118
119
120
# File 'lib/groonga/expression-builder.rb', line 116

def initialize(operation, *expression_builders)
  super()
  @operation = operation
  @expression_builders = expression_builders
end

Instance Method Details

#build(expression, variable) ⇒ Object



122
123
124
125
126
127
128
# File 'lib/groonga/expression-builder.rb', line 122

def build(expression, variable)
  return if @expression_builders.empty?
  @expression_builders.each do |builder|
    builder.build(expression, variable)
  end
  expression.append_operation(@operation, @expression_builders.size)
end