lib/loqate/api_result.rb in loqate-0.11.1 vs lib/loqate/api_result.rb in loqate-0.12.0

- old
+ new

@@ -13,9 +13,22 @@ # def initialize(items) @items = items end + def self.error(status:) + new( + [ + { + 'Error' => '-2', + 'Description' => 'Something went wrong - please try again later', + 'Resolution' => 'Try again later', + 'Cause' => "Server returned response with #{status}" + } + ] + ) + end + # Whether the response contains errors # # @return [Boolean] true if the response has errors and false otherwise # def errors?