Class: DevOpsReport::IdeaToProductionStep

Inherits:
Object
  • Object
show all
Defined in:
app/models/dev_ops_report/idea_to_production_step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric:, title:, features:) ⇒ IdeaToProductionStep

Returns a new instance of IdeaToProductionStep.


7
8
9
10
11
# File 'app/models/dev_ops_report/idea_to_production_step.rb', line 7

def initialize(metric:, title:, features:)
  self.metric = metric
  self.title = title
  self.features = features
end

Instance Attribute Details

#featuresObject

Returns the value of attribute features.


5
6
7
# File 'app/models/dev_ops_report/idea_to_production_step.rb', line 5

def features
  @features
end

#metricObject

Returns the value of attribute metric.


5
6
7
# File 'app/models/dev_ops_report/idea_to_production_step.rb', line 5

def metric
  @metric
end

#titleObject

Returns the value of attribute title.


5
6
7
# File 'app/models/dev_ops_report/idea_to_production_step.rb', line 5

def title
  @title
end

Instance Method Details

#percentage_scoreObject


13
14
15
16
17
18
19
# File 'app/models/dev_ops_report/idea_to_production_step.rb', line 13

def percentage_score
  sum = features.sum do |feature|
    metric.percentage_score(feature)
  end

  sum / features.size.to_f
end