class Tire::Search::BoostingQuery

Public Class Methods

new(options={}, &block) click to toggle source
# File lib/tire/search/query.rb, line 253
def initialize(options={}, &block)
  @options = options
  @value   = {}
  block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given?
end

Public Instance Methods

negative(&block) click to toggle source
# File lib/tire/search/query.rb, line 264
def negative(&block)
  (@value[:negative] ||= []) << Query.new(&block).to_hash
  @value
end
positive(&block) click to toggle source
# File lib/tire/search/query.rb, line 259
def positive(&block)
  (@value[:positive] ||= []) << Query.new(&block).to_hash
  @value
end
to_hash() click to toggle source
# File lib/tire/search/query.rb, line 269
def to_hash
  @value.update(@options)
end