Class: StudFinder::Coverage::Cobertura
- Inherits:
-
Object
- Object
- StudFinder::Coverage::Cobertura
- Defined in:
- lib/stud_finder/coverage/cobertura.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#missing_files ⇒ Object
readonly
Returns the value of attribute missing_files.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path:, files:, project_root: nil) ⇒ Cobertura
constructor
A new instance of Cobertura.
Constructor Details
#initialize(path:, files:, project_root: nil) ⇒ Cobertura
Returns a new instance of Cobertura.
12 13 14 15 16 17 |
# File 'lib/stud_finder/coverage/cobertura.rb', line 12 def initialize(path:, files:, project_root: nil) @path = path @files = files @project_root = project_root @missing_files = [] end |
Instance Attribute Details
#missing_files ⇒ Object (readonly)
Returns the value of attribute missing_files.
10 11 12 |
# File 'lib/stud_finder/coverage/cobertura.rb', line 10 def missing_files @missing_files end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 |
# File 'lib/stud_finder/coverage/cobertura.rb', line 19 def call reported = parse_report @missing_files = @files.reject { |file| reported.key?(file) } @files.to_h { |file| [file, reported.fetch(file, 0.0)] } end |