Class: Arelastic::Aggregations::Aggregation
- Inherits:
-
Nodes::Node
- Object
- Nodes::Node
- Arelastic::Aggregations::Aggregation
- Defined in:
- lib/arelastic/aggregations/aggregation.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #as_elastic ⇒ Object
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, options = {}) ⇒ Aggregation
constructor
A new instance of Aggregation.
- #nested(path) ⇒ Object
Methods inherited from Nodes::Node
Methods included from Arelastic::Arities::Binary
Methods included from Arelastic::Arities::Polyadic
Methods included from Arelastic::Arities::Unary
Constructor Details
#initialize(name, options = {}) ⇒ Aggregation
Returns a new instance of Aggregation.
6 7 8 9 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 6 def initialize(name, = {}) @name = name @options = end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 4 def @options end |
Instance Method Details
#as_elastic ⇒ Object
11 12 13 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 11 def as_elastic {name => as_elastic_aggregation} end |
#as_elastic_aggregation ⇒ Object
19 20 21 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 19 def as_elastic_aggregation raise 'not implemented' end |
#nested(path) ⇒ Object
15 16 17 |
# File 'lib/arelastic/aggregations/aggregation.rb', line 15 def nested(path) Arelastic::Aggregations::Nested.new(name, path, [self]) end |