Class: CodeKeeper::Result
- Inherits:
-
Object
- Object
- CodeKeeper::Result
- Defined in:
- lib/code_keeper/result.rb
Overview
Store results of each score.
Instance Attribute Summary collapse
-
#scores ⇒ Object
readonly
Returns the value of attribute scores.
Instance Method Summary collapse
- #add(metric, klass_or_path, score) ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
8 9 10 |
# File 'lib/code_keeper/result.rb', line 8 def initialize @scores = CodeKeeper.config.metrics.map { |key| [key, {}] }.to_h end |
Instance Attribute Details
#scores ⇒ Object (readonly)
Returns the value of attribute scores.
6 7 8 |
# File 'lib/code_keeper/result.rb', line 6 def scores @scores end |
Instance Method Details
#add(metric, klass_or_path, score) ⇒ Object
12 13 14 |
# File 'lib/code_keeper/result.rb', line 12 def add(metric, klass_or_path, score) scores[:"#{metric}"].store(klass_or_path, score) end |