Class: ChewyQuery::Builder::Nodes::Query

Inherits:
Expr
  • Object
show all
Defined in:
lib/chewy_query/builder/nodes/query.rb

Instance Method Summary collapse

Methods inherited from Expr

#!, #&, #|, #~

Methods inherited from Base

#eql?, #render

Constructor Details

#initialize(query, options = {}) ⇒ Query

Returns a new instance of Query.



5
6
7
8
# File 'lib/chewy_query/builder/nodes/query.rb', line 5

def initialize(query, options = {})
  @query = query
  @options = options
end

Instance Method Details

#__render__Object



10
11
12
13
14
15
16
# File 'lib/chewy_query/builder/nodes/query.rb', line 10

def __render__
  if @options.key?(:cache)
    { fquery: { query: @query, _cache: !!@options[:cache] } }
  else
    { query: @query }
  end
end