debian-mirror-gitlab/app/models/conversational_development_index/idea_to_production_step.rb

20 lines
416 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
module ConversationalDevelopmentIndex
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
sum = features.sum do |feature|
metric.percentage_score(feature)
end
sum / features.size.to_f
end
end
end