Class: ElasticQuery::QueryCollection
- Defined in:
- lib/elastic_query/query_collection.rb
Overview
This class represents Arrays of contitions like
Which woult be euqivalent to
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#queries ⇒ Object
Returns the value of attribute queries.
Instance Method Summary collapse
-
#initialize(key, queries) ⇒ QueryCollection
constructor
A new instance of QueryCollection.
- #to_hash ⇒ Object
Constructor Details
#initialize(key, queries) ⇒ QueryCollection
Returns a new instance of QueryCollection.
26 27 28 29 |
# File 'lib/elastic_query/query_collection.rb', line 26 def initialize(key, queries) @key = key @queries = queries end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
22 23 24 |
# File 'lib/elastic_query/query_collection.rb', line 22 def key @key end |
#queries ⇒ Object
Returns the value of attribute queries.
22 23 24 |
# File 'lib/elastic_query/query_collection.rb', line 22 def queries @queries end |
Instance Method Details
#to_hash ⇒ Object
31 32 33 34 35 |
# File 'lib/elastic_query/query_collection.rb', line 31 def to_hash { key => queries.map(&:to_hash) } end |