Class: Elasticband::Aggregation::TopHits

Inherits:
Elasticband::Aggregation show all
Defined in:
lib/elasticband/aggregation/top_hits.rb

Constant Summary

Constants inherited from Elasticband::Aggregation

PARSE_AGGREGATIONS

Instance Attribute Summary collapse

Attributes inherited from Elasticband::Aggregation

#name

Instance Method Summary collapse

Methods inherited from Elasticband::Aggregation

merge, parse

Constructor Details

#initialize(name, size, options = {}) ⇒ TopHits

Returns a new instance of TopHits.



6
7
8
9
10
# File 'lib/elasticband/aggregation/top_hits.rb', line 6

def initialize(name, size, options = {})
  super(name)
  self.size = size
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/elasticband/aggregation/top_hits.rb', line 4

def options
  @options
end

#sizeObject

Returns the value of attribute size.



4
5
6
# File 'lib/elasticband/aggregation/top_hits.rb', line 4

def size
  @size
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/elasticband/aggregation/top_hits.rb', line 12

def to_h
  super(top_hits_hash)
end