Class: Hashira::Report::Json
- Inherits:
-
Object
- Object
- Hashira::Report::Json
- Defined in:
- lib/hashira/report/json.rb
Instance Method Summary collapse
-
#initialize(graph, findings, io: $stdout) ⇒ Json
constructor
A new instance of Json.
- #print ⇒ Object
Constructor Details
#initialize(graph, findings, io: $stdout) ⇒ Json
Returns a new instance of Json.
8 9 10 11 12 |
# File 'lib/hashira/report/json.rb', line 8 def initialize(graph, findings, io: $stdout) @graph = graph @findings = findings @io = io end |
Instance Method Details
#print ⇒ Object
14 15 16 17 18 |
# File 'lib/hashira/report/json.rb', line 14 def print @io.puts JSON.pretty_generate(packages:, edges:, findings: @findings.all.map(&:to_h), accepted: accepted_entries) 0 end |