Class: Decidim::MetricOperationManifest

Inherits:
MetricManifest show all
Defined in:
decidim-core/lib/decidim/metric_operation_manifest.rb

Overview

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

Constant Summary

Constants included from AttributeObject::TypeMap

AttributeObject::TypeMap::Boolean, AttributeObject::TypeMap::Decimal

Instance Method Summary collapse

Methods inherited from MetricManifest

#has_settings?, #settings, #stat_block

Methods included from AttributeObject::Model

#[], #[]=, #attributes, #attributes_with_values, #initialize, #to_h

Instance Method Details

#calculate(day, resource) ⇒ Object



14
15
16
17
18
19
# File 'decidim-core/lib/decidim/metric_operation_manifest.rb', line 14

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

  operation.calculate
end