Class: ElasticQuery::NestedQuery
- Defined in:
- lib/elastic_query/nested_query.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Query
Instance Method Summary collapse
-
#initialize(object, query, options = {}) ⇒ NestedQuery
constructor
A new instance of NestedQuery.
- #to_hash ⇒ Object
Constructor Details
#initialize(object, query, options = {}) ⇒ NestedQuery
Returns a new instance of NestedQuery.
5 6 7 8 9 |
# File 'lib/elastic_query/nested_query.rb', line 5 def initialize(object, query, = {}) @object = object @options = super(query) end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
3 4 5 |
# File 'lib/elastic_query/nested_query.rb', line 3 def object @object end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/elastic_query/nested_query.rb', line 3 def @options end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/elastic_query/nested_query.rb', line 11 def to_hash { nested: { path: object.to_s, filter: query.to_hash, }.merge() } end |