Class: Browsable::Formatters::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/browsable/formatters/json.rb

Overview

Machine-readable formatter. This is the universal interface: the LSP server and any future MCP server consume exactly this structure. The human and github formatters are just alternate presentations of it.

Instance Method Summary collapse

Constructor Details

#initialize(report) ⇒ Json

Returns a new instance of Json.



11
12
13
# File 'lib/browsable/formatters/json.rb', line 11

def initialize(report)
  @report = report
end

Instance Method Details

#renderObject



15
16
17
# File 'lib/browsable/formatters/json.rb', line 15

def render
  JSON.pretty_generate(@report.as_json)
end