# File lib/tire/search/query.rb, line 211 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 217 def query(&block) (@value[:queries] ||= []) << Query.new(&block).to_hash @value end
# File lib/tire/search/query.rb, line 222 def to_hash @value.update(@options) end
# File lib/tire/search/query.rb, line 226 def to_json(options={}) to_hash.to_json end