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.25.0.rc4 lib/decidim/metric_operation_manifest.rb
decidim-core-0.25.0.rc3 lib/decidim/metric_operation_manifest.rb
decidim-core-0.25.0.rc2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.25.0.rc1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.3 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.6 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.5 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.0 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.0.rc2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.4 lib/decidim/metric_operation_manifest.rb
decidim-core-0.24.0.rc1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.3 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.2 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.1.rc1 lib/decidim/metric_operation_manifest.rb
decidim-core-0.23.0 lib/decidim/metric_operation_manifest.rb
decidim-core-0.22.0 lib/decidim/metric_operation_manifest.rb
decidim-core-0.21.0 lib/decidim/metric_operation_manifest.rb