Class: SimpleCov::ResultAdapter
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/simplecov/result_adapter.rb |
Overview
Responsible for adapting the format of the coverage result whether it’s default or with statistics
Class Method Summary
- .call(*args)
- .new(result) ⇒ ResultAdapter constructor
Instance Attribute Summary
- #result readonly
Instance Method Summary
Constructor Details
.new(result) ⇒ ResultAdapter
Class Method Details
.call(*args)
[ GitHub ]Instance Attribute Details
#result (readonly)
[ GitHub ]# File 'lib/simplecov/result_adapter.rb', line 8
attr_reader :result
Instance Method Details
#adapt
[ GitHub ]# File 'lib/simplecov/result_adapter.rb', line 18
def adapt return unless result result.each_with_object({}) do |(file_name, cover_statistic), adapted_result| if cover_statistic.is_a?(Array) adapted_result.merge!(file_name => {"lines" => cover_statistic}) else adapted_result.merge!(file_name => cover_statistic) end end end