Class: Elasticband::Aggregation::FieldBased
- Inherits:
-
Elasticband::Aggregation
- Object
- Elasticband::Aggregation
- Elasticband::Aggregation::FieldBased
- Defined in:
- lib/elasticband/aggregation/field_based.rb
Constant Summary
Constants inherited from Elasticband::Aggregation
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
Attributes inherited from Elasticband::Aggregation
Instance Method Summary collapse
-
#initialize(name, field, options = {}) ⇒ FieldBased
constructor
A new instance of FieldBased.
- #to_h ⇒ Object
- #type ⇒ Object
Methods inherited from Elasticband::Aggregation
Constructor Details
#initialize(name, field, options = {}) ⇒ FieldBased
Returns a new instance of FieldBased.
6 7 8 9 10 |
# File 'lib/elasticband/aggregation/field_based.rb', line 6 def initialize(name, field, = {}) super(name) self.field = field && field.to_sym self. = end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
4 5 6 |
# File 'lib/elasticband/aggregation/field_based.rb', line 4 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/elasticband/aggregation/field_based.rb', line 4 def @options end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/elasticband/aggregation/field_based.rb', line 12 def to_h super(aggregation_hash) end |
#type ⇒ Object
16 17 18 |
# File 'lib/elasticband/aggregation/field_based.rb', line 16 def type raise NotImplementedError end |