Class: Elastic::Results::Root

Inherits:
HitCollection show all
Defined in:
lib/elastic/results/root.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HitCollection

#each_hit

Methods inherited from ScoredCollection

#[], #count, #each, #each_with_score, #last, #map_with_score

Methods inherited from Base

#as_value

Methods included from Support::Traversable

#pick_nodes

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

#aggregationsObject (readonly)

Returns the value of attribute aggregations.



3
4
5
# File 'lib/elastic/results/root.rb', line 3

def aggregations
  @aggregations
end

#totalObject (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