class SimpleCovLinterFormatter::JsonResultExporter
Public Class Methods
new(result_hash)
click to toggle source
# File lib/simplecov_linter_formatter/exporters/json_result_exporter.rb, line 3 def initialize(result_hash) @result = result_hash end
Public Instance Methods
export()
click to toggle source
# File lib/simplecov_linter_formatter/exporters/json_result_exporter.rb, line 7 def export File.open(export_path, 'w') do |file| file << json_result end end
Private Instance Methods
export_path()
click to toggle source
# File lib/simplecov_linter_formatter/exporters/json_result_exporter.rb, line 19 def export_path File.join(SimpleCov.coverage_path, SimpleCovLinterFormatter.json_filename) end
json_result()
click to toggle source
# File lib/simplecov_linter_formatter/exporters/json_result_exporter.rb, line 15 def json_result JSON.pretty_generate(@result) end