Class: ElasticQuery::QueryWrapper

Inherits:
Query show all
Defined in:
lib/elastic_query/query_wrapper.rb

Instance Attribute Summary collapse

Attributes inherited from Query

#query

Instance Method Summary collapse

Constructor Details

#initialize(key, query) ⇒ QueryWrapper

Returns a new instance of QueryWrapper.



5
6
7
8
# File 'lib/elastic_query/query_wrapper.rb', line 5

def initialize(key, query)
  @key = key
  super(query)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/elastic_query/query_wrapper.rb', line 3

def key
  @key
end

Instance Method Details

#to_hashObject



10
11
12
13
14
# File 'lib/elastic_query/query_wrapper.rb', line 10

def to_hash
  {
    key => query.to_hash
  }
end