From ab95e3bfb9ad44dc33478821d25d75c8dc758de1 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 30 May 2022 21:51:35 -0500 Subject: [PATCH] Bad XML parser produces hash for one element, array for >1 --- .rubocop.yml | 3 +++ lib/bandwidth_iris_patch.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index d290352114c201c1732fcbf97f9267f89294494b..325e60072c58e5aa59e626e8c6fab731fb62d190 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -73,6 +73,9 @@ Layout/MultilineMethodCallIndentation: Style/AccessModifierDeclarations: Enabled: false +Style/ArrayCoercion: + Enabled: false + Style/StringLiterals: EnforcedStyle: double_quotes diff --git a/lib/bandwidth_iris_patch.rb b/lib/bandwidth_iris_patch.rb index 98715162d861a81040cadc75d5582674141f7560..3058cb285841a75023996eb8c7191010b1e08c05 100644 --- a/lib/bandwidth_iris_patch.rb +++ b/lib/bandwidth_iris_patch.rb @@ -21,6 +21,7 @@ module BandwidthIris attr_reader :errors def initialize(errors) + errors = [errors] unless errors.is_a?(Array) super(errors.map { |e| e[:description] }.join("\n")) @errors = errors end