gitlab-org--gitlab-foss/app/models/dev_ops_report/idea_to_production_step.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
429 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module DevOpsReport
class IdeaToProductionStep
attr_accessor :metric, :title, :features
def initialize(metric:, title:, features:)
self.metric = metric
self.title = title
self.features = features
end
def percentage_score
2017-06-02 15:17:24 +00:00
sum = features.sum do |feature|
metric.percentage_score(feature)
2017-06-02 15:17:24 +00:00
end
sum / features.size.to_f
end
end
end