Class: Queries::BaseQueryBuilder

Inherits:
QueryBuilder show all
Defined in:
lib/queries/base_query_builder.rb

Overview

Wraps a query keyword around the query of the given object

Constant Summary collapse

NAME =
'query'

Instance Method Summary collapse

Methods inherited from QueryBuilder

#boost

Methods included from AttributesReader

#attributes

Methods included from AbstractQueryBuilder

#do_equals?, #name

Constructor Details

#initialize(inner_query:) ⇒ BaseQueryBuilder

Returns a new instance of BaseQueryBuilder.



11
12
13
# File 'lib/queries/base_query_builder.rb', line 11

def initialize(inner_query:)
  @inner_query = inner_query
end

Instance Method Details

#queryHash

Returns serialized query hash for the object.

Returns:

  • (Hash)

    serialized query hash for the object



16
17
18
19
# File 'lib/queries/base_query_builder.rb', line 16

def query
  query = { name.intern => inner_query.query }
  query
end