Class: Elasticated::CustomAggregation

Inherits:
Aggregation show all
Defined in:
lib/elasticated/aggregations/custom_aggregation.rb

Instance Attribute Summary collapse

Attributes inherited from Aggregation

#alias_name, #extra_params, #field

Instance Method Summary collapse

Methods inherited from Aggregation

#name, #original_name

Methods included from Mixins::Inspectionable

#inspect, #text_for_inspect

Methods included from Mixins::BlockEvaluation

#evaluate

Methods included from Mixins::Clonable

#==, #clone

Constructor Details

#initialize(name, &block) ⇒ CustomAggregation

Returns a new instance of CustomAggregation.



6
7
8
9
10
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 6

def initialize(name, &block)
  self._name = name
  super
  self._hash = block.call
end

Instance Attribute Details

#_hashObject

Returns the value of attribute _hash.



4
5
6
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 4

def _hash
  @_hash
end

#_nameObject

Returns the value of attribute _name.



4
5
6
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 4

def _name
  @_name
end

Instance Method Details

#buildObject



16
17
18
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 16

def build
  _hash
end

#default_nameObject



12
13
14
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 12

def default_name
  _name
end

#parse(response) ⇒ Object



20
21
22
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 20

def parse(response)
  response
end