# File lib/tire/search/query.rb, line 119 def initialize(&block) @value = {} block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given? end
# File lib/tire/search/query.rb, line 129 def filter(type, *options) @value[:filter] ||= [] @value[:filter] << Filter.new(type, *options).to_hash @value end
# File lib/tire/search/query.rb, line 124 def query(options={}, &block) @value[:query] = Query.new(&block).to_hash @value end
# File lib/tire/search/query.rb, line 135 def to_hash @value end
# File lib/tire/search/query.rb, line 139 def to_json to_hash.to_json end