class Tire::Search::NestedQuery

Public Class Methods

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

Public Instance Methods

query(&block) click to toggle source
# File lib/tire/search/query.rb, line 238
def query(&block)
  @value[:query] = Query.new(&block).to_hash
  @value
end
to_hash() click to toggle source
# File lib/tire/search/query.rb, line 243
def to_hash
  @value.update(@options)
end
to_json() click to toggle source
# File lib/tire/search/query.rb, line 247
def to_json
  to_hash.to_json
end