Class: Elastic::Results::Root
- Inherits:
-
HitCollection
- Object
- Base
- ScoredCollection
- HitCollection
- Elastic::Results::Root
- Defined in:
- lib/elastic/results/root.rb
Instance Attribute Summary collapse
-
#aggregations ⇒ Object
readonly
Returns the value of attribute aggregations.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(_hits, _total, _aggs) ⇒ Root
constructor
A new instance of Root.
- #traverse(&_block) ⇒ Object
Methods inherited from HitCollection
Methods inherited from ScoredCollection
#[], #count, #each, #each_with_score, #last, #map_with_score
Methods inherited from Base
Methods included from Support::Traversable
Constructor Details
#initialize(_hits, _total, _aggs) ⇒ Root
Returns a new instance of Root.
5 6 7 8 9 |
# File 'lib/elastic/results/root.rb', line 5 def initialize(_hits, _total, _aggs) super _hits @total = _total @aggregations = Aggregations.new _aggs end |
Instance Attribute Details
#aggregations ⇒ Object (readonly)
Returns the value of attribute aggregations.
3 4 5 |
# File 'lib/elastic/results/root.rb', line 3 def aggregations @aggregations end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/elastic/results/root.rb', line 3 def total @total end |
Instance Method Details
#traverse(&_block) ⇒ Object
11 12 13 14 |
# File 'lib/elastic/results/root.rb', line 11 def traverse(&_block) super aggregations.traverse(&_block) end |