Class: DevOpsReport::IdeaToProductionStep
- Inherits:
-
Object
- Object
- DevOpsReport::IdeaToProductionStep
- Defined in:
- app/models/dev_ops_report/idea_to_production_step.rb
Instance Attribute Summary collapse
-
#features ⇒ Object
Returns the value of attribute features.
-
#metric ⇒ Object
Returns the value of attribute metric.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(metric:, title:, features:) ⇒ IdeaToProductionStep
constructor
A new instance of IdeaToProductionStep.
- #percentage_score ⇒ Object
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
#features ⇒ Object
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 |
#metric ⇒ Object
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 |
#title ⇒ Object
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_score ⇒ Object
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 |