Module: Moult::Formatters::DuplicationJson

Defined in:
lib/moult/formatters/duplication_json.rb

Overview

Emits the typed duplication JSON contract (schema/duplication.schema.json). Renders straight from DuplicationReport#to_h so the serialized shape cannot drift from the result model.

Class Method Summary collapse

Class Method Details

.render(report) ⇒ String

Returns pretty-printed JSON.

Parameters:

Returns:

  • (String)

    pretty-printed JSON



15
16
17
# File 'lib/moult/formatters/duplication_json.rb', line 15

def render(report)
  JSON.pretty_generate(report.to_h)
end