Class: Kaisoku::Reporters::JSON
- Inherits:
-
Object
- Object
- Kaisoku::Reporters::JSON
- Defined in:
- lib/kaisoku/reporters/json.rb
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ JSON
constructor
A new instance of JSON.
- #results(results) ⇒ Object
- #selection(selection, selected_count:, total_count:) ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ JSON
Returns a new instance of JSON.
8 9 10 |
# File 'lib/kaisoku/reporters/json.rb', line 8 def initialize(output: $stdout) @output = output end |
Instance Method Details
#results(results) ⇒ Object
23 24 25 |
# File 'lib/kaisoku/reporters/json.rb', line 23 def results(results) @output.puts ::JSON.pretty_generate(selection: @selection, results: results) end |
#selection(selection, selected_count:, total_count:) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kaisoku/reporters/json.rb', line 12 def selection(selection, selected_count:, total_count:) @selection = { selected: selected_count, total: total_count, reason: selection.reason, safe: selection.safe?, fallback: selection.fallback?, warnings: selection.warnings } end |