Sha256: 6b2c47b4c9abbea460a8dc7b19e635bcd74d62160e58899be69fe00788d41f04

Contents?: true

Size: 589 Bytes

Versions: 64

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This class acts as a manifest for metrics operations.
  #
  # This manifest is an expansion from Decidim::MetricManifest that holds and stores
  # operations, metrics and measure class, for operations purpose
  #
  class MetricOperationManifest < Decidim::MetricManifest
    attribute :metric_operation, String

    validates :metric_operation, presence: true

    def calculate(day, resource)
      operation = manager_class.constantize.new(day, resource)
      return unless operation.valid?

      operation.calculate
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
decidim-core-0.29.1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.4 lib/decidim/metric_operation_manifest.rb
decidim-core-0.27.9 lib/decidim/metric_operation_manifest.rb
decidim-core-0.29.0 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.3 lib/decidim/metric_operation_manifest.rb
decidim-core-0.27.8 lib/decidim/metric_operation_manifest.rb
decidim-core-0.29.0.rc4 lib/decidim/metric_operation_manifest.rb
decidim-core-0.29.0.rc3 lib/decidim/metric_operation_manifest.rb
decidim-core-0.29.0.rc2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.29.0.rc1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.27.7 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.27.6 lib/decidim/metric_operation_manifest.rb
decidim-core-0.26.10 lib/decidim/metric_operation_manifest.rb
decidim-core-0.26.9 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.0 lib/decidim/metric_operation_manifest.rb
decidim-core-0.27.5 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.0.rc5 lib/decidim/metric_operation_manifest.rb
decidim-core-0.28.0.rc4 lib/decidim/metric_operation_manifest.rb