Class: Elastic::Results::Bucket
- Inherits:
-
Aggregations
- Object
- Base
- Aggregations
- Elastic::Results::Bucket
- Defined in:
- lib/elastic/results/bucket.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #as_value ⇒ Object
-
#initialize(_key, _total, _aggs) ⇒ Bucket
constructor
A new instance of Bucket.
Methods inherited from Aggregations
Methods inherited from Base
Methods included from Support::Traversable
Constructor Details
#initialize(_key, _total, _aggs) ⇒ Bucket
Returns a new instance of Bucket.
5 6 7 8 9 |
# File 'lib/elastic/results/bucket.rb', line 5 def initialize(_key, _total, _aggs) @key = _key @total = _total super _aggs end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/elastic/results/bucket.rb', line 3 def key @key end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/elastic/results/bucket.rb', line 3 def total @total end |
Instance Method Details
#as_value ⇒ Object
11 12 13 14 |
# File 'lib/elastic/results/bucket.rb', line 11 def as_value # TODO: return aggregation value if configured as single bucket self end |