Class: Elastic::Dsl::ResultComposer

Inherits:
Object
  • Object
show all
Includes:
MetricBuilder
Defined in:
lib/elastic/dsl/result_composer.rb

Instance Method Summary collapse

Methods included from MetricBuilder

#average, #closing, #maximum, #minimum, #opening, #stats, #sum

Constructor Details

#initialize(_aggs) ⇒ ResultComposer

Returns a new instance of ResultComposer.



5
6
7
# File 'lib/elastic/dsl/result_composer.rb', line 5

def initialize(_aggs)
  @aggs = _aggs
end

Instance Method Details

#aggregate(_node) ⇒ Object

Raises:

  • (ArgumentError)


9
10
11
12
13
# File 'lib/elastic/dsl/result_composer.rb', line 9

def aggregate(_node)
  raise ArgumentError, 'node must provide a name' unless _node.name
  @aggs << _node
  nil
end