Skip to content

Commit 5811a8d

Browse files
author
Kevin Paulisse
committed
Call construct method rather than new object
1 parent d9b202b commit 5811a8d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/octocatalog-diff/api/v1/catalog-diff.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def self.catalog_diff(options = nil)
5757

5858
# Return diffs and catalogs in expected format
5959
OpenStruct.new(
60-
diffs: diffs.map { |x| OctocatalogDiff::API::V1::Diff.new(x) },
60+
diffs: diffs.map { |x| OctocatalogDiff::API::V1::Diff.construct(x) },
6161
from: OctocatalogDiff::API::V1::Catalog.new(catalogs[:from]),
6262
to: OctocatalogDiff::API::V1::Catalog.new(catalogs[:to])
6363
)

lib/octocatalog-diff/catalog-diff/display.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Display
2525
def self.output(diff_in, options = {}, logger = nil)
2626
diff_x = diff_in.is_a?(OctocatalogDiff::CatalogDiff::Differ) ? diff_in.diff : diff_in
2727
raise ArgumentError, "text_output requires Array<Diff results>; passed in #{diff_in.class}" unless diff_x.is_a?(Array)
28-
diff = diff_x.map { |x| OctocatalogDiff::API::V1::Diff.new(x) }
28+
diff = diff_x.map { |x| OctocatalogDiff::API::V1::Diff.construct(x) }
2929

3030
# req_format means 'requested format' because 'format' has a built-in meaning to Ruby
3131
req_format = options.fetch(:format, :color_text)

0 commit comments

Comments
 (0)