Class: SimpleCovJSONFormatter::ResultExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov_json_formatter/result_exporter.rb

Constant Summary collapse

FILENAME =
'coverage.json'

Instance Method Summary collapse

Constructor Details

#initialize(result_hash) ⇒ ResultExporter

Returns a new instance of ResultExporter.



7
8
9
# File 'lib/simplecov_json_formatter/result_exporter.rb', line 7

def initialize(result_hash)
  @result = result_hash
end

Instance Method Details

#exportObject



11
12
13
14
15
# File 'lib/simplecov_json_formatter/result_exporter.rb', line 11

def export
  File.open(export_path, 'w') do |file|
    file << json_result
  end
end