Class: StudFinder::Coverage::Resultset
- Inherits:
-
Object
- Object
- StudFinder::Coverage::Resultset
- Defined in:
- lib/stud_finder/coverage/resultset.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) ⇒ Resultset
constructor
A new instance of Resultset.
Constructor Details
#initialize(path:, files:, project_root: nil) ⇒ Resultset
Returns a new instance of Resultset.
13 14 15 16 17 18 19 |
# File 'lib/stud_finder/coverage/resultset.rb', line 13 def initialize(path:, files:, project_root: nil) @path = path @files = files @file_set = Set.new(files) @project_root = File.(project_root) if project_root @missing_files = [] end |
Instance Attribute Details
#missing_files ⇒ Object (readonly)
Returns the value of attribute missing_files.
11 12 13 |
# File 'lib/stud_finder/coverage/resultset.rb', line 11 def missing_files @missing_files end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/stud_finder/coverage/resultset.rb', line 21 def call reported = parse_report @missing_files = @files.reject { |file| reported.key?(file) } @files.to_h { |file| [file, reported.fetch(file, 0.0)] } end |