class ArtirixDataModels::AggregationsFactory::SortedBucketsAggregationClassFactory::SortedBucketAggregationBase

Public Class Methods

sort_by_callable() click to toggle source
# File lib/artirix_data_models/aggregations_factory.rb, line 118
def self.sort_by_callable
  @sort_by_callable
end
sort_by_callable=(callable = nil, &block) click to toggle source
# File lib/artirix_data_models/aggregations_factory.rb, line 122
def self.sort_by_callable=(callable = nil, &block)
  raise ArgumentError unless callable || block

  @sort_by_callable = callable || block
end

Public Instance Methods

buckets() click to toggle source
# File lib/artirix_data_models/aggregations_factory.rb, line 110
def buckets
  @sorted_buckets ||= sort_buckets
end
Also aliased as: unordered_buckets
sort_buckets() click to toggle source
# File lib/artirix_data_models/aggregations_factory.rb, line 114
def sort_buckets
  unordered_buckets.sort_by { |bucket| self.class.sort_by_callable.call(bucket) }
end
unordered_buckets()
Alias for: buckets