Class: Necropsy::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/necropsy/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(report) ⇒ Reporter

Returns a new instance of Reporter.



5
6
7
# File 'lib/necropsy/reporter.rb', line 5

def initialize(report)
  @report = report
end

Instance Method Details

#render(format: :human, min_confidence: :low) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/necropsy/reporter.rb', line 9

def render(format: :human, min_confidence: :low)
  case format.to_sym
  when :json
    report.to_json
  when :sarif
    render_sarif(min_confidence)
  when :github, :annotations
    render_github_annotations(min_confidence)
  when :yaml, :yml
    report.to_yaml
  else
    render_human(min_confidence)
  end
end