Class: Arelastic::Queries::HasChild
- Inherits:
-
Query
- Object
- Nodes::Node
- Query
- Arelastic::Queries::HasChild
- Defined in:
- lib/arelastic/queries/has_child.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(type, query) ⇒ HasChild
constructor
A new instance of HasChild.
Methods inherited from Query
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(type, query) ⇒ HasChild
Returns a new instance of HasChild.
6 7 8 9 |
# File 'lib/arelastic/queries/has_child.rb', line 6 def initialize type, query @type = type @query = query end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/arelastic/queries/has_child.rb', line 4 def query @query end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/arelastic/queries/has_child.rb', line 4 def type @type end |
Instance Method Details
#as_elastic ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/arelastic/queries/has_child.rb', line 11 def as_elastic { "has_child" => { "type" => type, "query" => convert_to_elastic(query) } } end |