# 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
# File lib/tire/search/query.rb, line 264 def negative(&block) (@value[:negative] ||= []) << Query.new(&block).to_hash @value end
# File lib/tire/search/query.rb, line 259 def positive(&block) (@value[:positive] ||= []) << Query.new(&block).to_hash @value end
# File lib/tire/search/query.rb, line 269 def to_hash @value.update(@options) end