Class: Arelastic::Aggregations::BucketSort
- Inherits:
-
Aggregation
- Object
- Nodes::Node
- Aggregation
- Arelastic::Aggregations::BucketSort
- Defined in:
- lib/arelastic/aggregations/bucket_sort.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#size ⇒ Object
Returns the value of attribute size.
-
#sort ⇒ Object
Returns the value of attribute sort.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, options = {}) ⇒ BucketSort
constructor
A new instance of BucketSort.
Methods inherited from Aggregation
#as_elastic, #nested, #reverse_nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arelastic::Arities::Binary
Methods included from Arelastic::Arities::Polyadic
Methods included from Arelastic::Arities::Unary
Constructor Details
#initialize(name, options = {}) ⇒ BucketSort
Returns a new instance of BucketSort.
6 7 8 9 10 11 12 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 6 def initialize(name, = {}) = .dup @from = read_option! , 'from' @size = read_option! , 'size' @sort = read_option! , 'sort' super(name, ) end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 4 def from @from end |
#size ⇒ Object
Returns the value of attribute size.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 4 def size @size end |
#sort ⇒ Object
Returns the value of attribute sort.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 4 def sort @sort end |
Instance Method Details
#as_elastic_aggregation ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 14 def as_elastic_aggregation bucket_sort = {} bucket_sort['sort'] = parse_sort if sort bucket_sort['from'] = from if from bucket_sort['size'] = size if size { 'bucket_sort' => bucket_sort } end |