Class: Groonga::ExpressionBuildable::MatchTargetExpressionBuilder

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

Instance Method Summary collapse

Methods inherited from ExpressionBuilder

#&, #-, #|

Constructor Details

#initialize(target) ⇒ MatchTargetExpressionBuilder

Returns a new instance of MatchTargetExpressionBuilder.



322
323
324
325
# File 'lib/groonga/expression-builder.rb', line 322

def initialize(target)
  super()
  @target = target
end

Instance Method Details

#=~(query) ⇒ Object



333
334
335
336
337
338
# File 'lib/groonga/expression-builder.rb', line 333

def =~(query)
  if query.nil?
    raise ArgumentError, "match word should not be nil"
  end
  MatchExpressionBuilder.new(self, query)
end

#build(expression, variable) ⇒ Object



327
328
329
330
331
# File 'lib/groonga/expression-builder.rb', line 327

def build(expression, variable)
  expression.append_object(variable)
  expression.append_object(@target)
  expression.append_operation(Groonga::Operation::GET_VALUE, 2)
end