Class: Elasticated::CustomAggregation
- Inherits:
-
Aggregation
- Object
- Aggregation
- Elasticated::CustomAggregation
- Defined in:
- lib/elasticated/aggregations/custom_aggregation.rb
Instance Attribute Summary collapse
-
#_hash ⇒ Object
Returns the value of attribute _hash.
-
#_name ⇒ Object
Returns the value of attribute _name.
Attributes inherited from Aggregation
#alias_name, #extra_params, #field
Instance Method Summary collapse
- #build ⇒ Object
- #default_name ⇒ Object
-
#initialize(name, &block) ⇒ CustomAggregation
constructor
A new instance of CustomAggregation.
- #parse(response) ⇒ Object
Methods inherited from Aggregation
Methods included from Mixins::Inspectionable
Methods included from Mixins::BlockEvaluation
Methods included from Mixins::Clonable
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
#_hash ⇒ Object
Returns the value of attribute _hash.
4 5 6 |
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 4 def _hash @_hash end |
#_name ⇒ Object
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
#build ⇒ Object
16 17 18 |
# File 'lib/elasticated/aggregations/custom_aggregation.rb', line 16 def build _hash end |
#default_name ⇒ Object
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 |