Class: Hashira::Report::Json
- Inherits:
-
Object
- Object
- Hashira::Report::Json
- Defined in:
- lib/hashira/report/json.rb
Constant Summary collapse
- SCHEMA =
1
Instance Method Summary collapse
-
#initialize(view, io: $stdout) ⇒ Json
constructor
A new instance of Json.
- #print ⇒ Object
Constructor Details
#initialize(view, io: $stdout) ⇒ Json
Returns a new instance of Json.
6 7 8 9 |
# File 'lib/hashira/report/json.rb', line 6 def initialize(view, io: $stdout) @view = view @io = io end |
Instance Method Details
#print ⇒ Object
13 14 15 16 |
# File 'lib/hashira/report/json.rb', line 13 def print @io.puts(@view.compact ? JSON.generate(payload) : JSON.pretty_generate(payload)) 0 end |