You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
metu.life/app/lib/admin/metrics/dimension.rb

15 lines
584 B

# frozen_string_literal: true
class Admin::Metrics::Dimension
DIMENSIONS = {
languages: Admin::Metrics::Dimension::LanguagesDimension,
sources: Admin::Metrics::Dimension::SourcesDimension,
servers: Admin::Metrics::Dimension::ServersDimension,
space_usage: Admin::Metrics::Dimension::SpaceUsageDimension,
software_versions: Admin::Metrics::Dimension::SoftwareVersionsDimension,
}.freeze
def self.retrieve(dimension_keys, start_at, end_at, limit)
Array(dimension_keys).map { |key| DIMENSIONS[key.to_sym]&.new(start_at, end_at, limit) }.compact
end
end