class ArtirixDataModels::CommonAggregation
Attributes
name[RW]
Public Class Methods
from_json(definition, value_class = Aggregation::Value, aggregations_factory: nil)
click to toggle source
DEPRECATED
# File lib/artirix_data_models/aggregation.rb, line 13 def self.from_json(definition, value_class = Aggregation::Value, aggregations_factory: nil) ActiveSupport::Deprecation.new('1.0', 'ArtirixDataModels').warn('`Aggregation.from_json` is deprecated in favour of `AggregationsFactory#aggregation_from_json`') aggregations_factory ||= DAORegistry.get(:aggregations_factory) aggregations_factory.aggregation_from_json(definition, value_class: value_class, aggregation_class: self) end
new(name)
click to toggle source
# File lib/artirix_data_models/aggregation.rb, line 8 def initialize(name) @name = name end
Public Instance Methods
pretty_name()
click to toggle source
# File lib/artirix_data_models/aggregation.rb, line 19 def pretty_name @pretty_name ||= load_pretty_name end
Private Instance Methods
default_pretty_name()
click to toggle source
# File lib/artirix_data_models/aggregation.rb, line 28 def default_pretty_name name end
load_pretty_name()
click to toggle source
# File lib/artirix_data_models/aggregation.rb, line 24 def load_pretty_name I18n.t("aggregations.#{name.to_s.gsub('.', '_')}.name", default: default_pretty_name) end