class Elasticband::Aggregation::TopHits

Attributes

options[RW]
size[RW]

Public Class Methods

new(name, size, options = {}) click to toggle source
Calls superclass method Elasticband::Aggregation::new
# File lib/elasticband/aggregation/top_hits.rb, line 6
def initialize(name, size, options = {})
  super(name)
  self.size = size
  self.options = options
end

Public Instance Methods

to_h() click to toggle source
Calls superclass method Elasticband::Aggregation#to_h
# File lib/elasticband/aggregation/top_hits.rb, line 12
def to_h
  super(top_hits_hash)
end

Private Instance Methods

top_hits_hash() click to toggle source
# File lib/elasticband/aggregation/top_hits.rb, line 18
def top_hits_hash
  { top_hits: { size: size }.merge!(options) }
end