Exception: ActionKitRest::Response::InvalidAkidError

Inherits:
ValidationError
  • Object
show all
Defined in:
lib/action_kit_rest/response/validation_error.rb

Constant Summary collapse

MATCHING_ERRORS =
['Unable to associate this mailing ID with account.',
'לא הצלחנו לקשר בין מספר הזיהוי של רשימת הדיוור הזו לבין החשבון.',
'لم ننجح في مطابقة العنوان الالكتروني مع الحساب.'].freeze

Instance Attribute Summary

Attributes inherited from ValidationError

#body, #errors, #url

Class Method Summary collapse

Methods inherited from ValidationError

#initialize, #to_s

Constructor Details

This class inherits a constructor from ActionKitRest::Response::ValidationError

Class Method Details

.matches?(errors) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
# File 'lib/action_kit_rest/response/validation_error.rb', line 30

def self.matches?(errors)
  return false unless errors&.keys == ['mailing_id']

  mailing_id_errors = errors['mailing_id']
  return false unless mailing_id_errors.size == 1

  MATCHING_ERRORS.include?(mailing_id_errors.first)
end