Class: OctocatalogDiff::CatalogDiff::Display::LegacyJson
- Inherits:
-
OctocatalogDiff::CatalogDiff::Display
- Object
- OctocatalogDiff::CatalogDiff::Display
- OctocatalogDiff::CatalogDiff::Display::LegacyJson
- Defined in:
- lib/octocatalog-diff/catalog-diff/display/legacy_json.rb
Overview
Display the output from a diff in JSON format. This is the legacy format, used in octocatalog-diff 0.x, where each diff is represented by an array.
Class Method Summary collapse
-
.generate(diff, options = {}, _logger = nil) ⇒ Object
Generate JSON representation of the ‘diff’ suitable for further analysis.
Methods inherited from OctocatalogDiff::CatalogDiff::Display
header, output, parse_diff_array_into_categorized_hashes, simple_deep_merge!
Class Method Details
.generate(diff, options = {}, _logger = nil) ⇒ Object
Generate JSON representation of the ‘diff’ suitable for further analysis.
18 19 20 21 22 23 24 |
# File 'lib/octocatalog-diff/catalog-diff/display/legacy_json.rb', line 18 def self.generate(diff, = {}, _logger = nil) result = { 'diff' => diff.map(&:raw) } result['header'] = [:header] unless [:header].nil? result.to_json end |