Class: Arelastic::Queries::HasParent
- Inherits:
-
Query
- Object
- Nodes::Node
- Query
- Arelastic::Queries::HasParent
- Defined in:
- lib/arelastic/queries/has_parent.rb
Instance Attribute Summary collapse
-
#parent_type ⇒ Object
readonly
Returns the value of attribute parent_type.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(parent_type, query) ⇒ HasParent
constructor
A new instance of HasParent.
Methods inherited from Query
#has_child, #has_parent, #negate, #nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(parent_type, query) ⇒ HasParent
Returns a new instance of HasParent.
6 7 8 9 |
# File 'lib/arelastic/queries/has_parent.rb', line 6 def initialize parent_type, query @parent_type = parent_type @query = query end |
Instance Attribute Details
#parent_type ⇒ Object (readonly)
Returns the value of attribute parent_type.
4 5 6 |
# File 'lib/arelastic/queries/has_parent.rb', line 4 def parent_type @parent_type end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/arelastic/queries/has_parent.rb', line 4 def query @query end |
Instance Method Details
#as_elastic ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/arelastic/queries/has_parent.rb', line 11 def as_elastic { "has_parent" => { "parent_type" => parent_type, "query" => convert_to_elastic(query) } } end |