Class: ArtirixDataModels::AggregationsFactory::SortedBucketsAggregationClassFactory::SortedBucketAggregationBase
- Inherits:
-
ArtirixDataModels::Aggregation
- Object
- CommonAggregation
- ArtirixDataModels::Aggregation
- ArtirixDataModels::AggregationsFactory::SortedBucketsAggregationClassFactory::SortedBucketAggregationBase
- Defined in:
- lib/artirix_data_models/aggregations_factory.rb
Constant Summary
Constants included from WithDAORegistry
WithDAORegistry::DEFAULT_DAO_REGISTRY_LOADER
Constants included from Inspectable
Instance Attribute Summary
Attributes inherited from CommonAggregation
Attributes included from WithDAORegistry
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ArtirixDataModels::Aggregation
#calculate_filtered, #data_hash, #filtered_buckets, #filtered_first_buckets, #initialize, #non_empty_buckets, #unfiltered_buckets
Methods inherited from CommonAggregation
from_json, #initialize, #pretty_name
Methods included from WithDAORegistry
#dao_registry, #dao_registry=, #default_dao_registry, loader_or_registry_or_default, #set_dao_registry, #set_dao_registry_and_loader, #set_dao_registry_loader, #set_default_dao_registry_loader
Methods included from Inspectable
#data_hash_for_inspect, #inspect, #inspect_with_tab
Constructor Details
This class inherits a constructor from ArtirixDataModels::Aggregation
Class Method Details
.sort_by_callable ⇒ Object
118 119 120 |
# 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) ⇒ Object
122 123 124 125 126 |
# 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 |
Instance Method Details
#buckets ⇒ Object
110 111 112 |
# File 'lib/artirix_data_models/aggregations_factory.rb', line 110 def buckets @sorted_buckets ||= sort_buckets end |
#sort_buckets ⇒ Object
114 115 116 |
# 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 ⇒ Object
108 |
# File 'lib/artirix_data_models/aggregations_factory.rb', line 108 alias_method :unordered_buckets, :buckets |