Class: ElasticsearchDslBuilder::DSL::Search::Aggregations::ReverseNested

Inherits:
Aggregation
  • Object
show all
Defined in:
lib/elasticsearch_dsl_builder/dsl/search/aggregations/reverse_nested.rb

Instance Method Summary collapse

Methods inherited from Aggregation

#aggregation

Constructor Details

#initializeReverseNested

Returns a new instance of ReverseNested.



6
7
8
9
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/reverse_nested.rb', line 6

def initialize
  @type = :reverse_nested
  super()
end

Instance Method Details

#path(path) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/reverse_nested.rb', line 11

def path(path)
  raise ArgumentError, 'path must be a String' unless path.instance_of?(String)
  @path = path
  self
end

#to_hashObject



17
18
19
20
21
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/reverse_nested.rb', line 17

def to_hash
  @aggregation = {}
  @aggregation.update(path: @path) if @path
  super
end