Class: Groonga::ExpressionBuildable::SetExpressionBuilder
- Inherits:
-
ExpressionBuilder
- Object
- ExpressionBuilder
- Groonga::ExpressionBuildable::SetExpressionBuilder
- Defined in:
- lib/groonga/expression-builder.rb
Direct Known Subclasses
AndExpressionBuilder, AndNotExpressionBuilder, OrExpressionBuilder
Instance Method Summary collapse
- #build(expression, variable) ⇒ Object
-
#initialize(operation, *expression_builders) ⇒ SetExpressionBuilder
constructor
A new instance of SetExpressionBuilder.
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 |