Class: LedgerSync::Adaptors::QuickBooksOnline::Util::AdaptorErrorParser
- Inherits:
-
ErrorParser
- Object
- ErrorParser
- LedgerSync::Adaptors::QuickBooksOnline::Util::AdaptorErrorParser
- Defined in:
- lib/ledger_sync/adaptors/quickbooks_online/util/adaptor_error_parser.rb
Defined Under Namespace
Classes: AuthenticationMatcher, AuthorizationMatcher, ClientMatcher, ThrottleMatcher
Constant Summary collapse
- PARSERS =
[ AuthenticationMatcher, AuthorizationMatcher, ClientMatcher, ThrottleMatcher ].freeze
Instance Attribute Summary collapse
-
#adaptor ⇒ Object
readonly
Returns the value of attribute adaptor.
Attributes inherited from ErrorParser
Instance Method Summary collapse
-
#initialize(adaptor:, error:) ⇒ AdaptorErrorParser
constructor
A new instance of AdaptorErrorParser.
- #parse ⇒ Object
Methods inherited from ErrorParser
Constructor Details
#initialize(adaptor:, error:) ⇒ AdaptorErrorParser
Returns a new instance of AdaptorErrorParser.
81 82 83 84 |
# File 'lib/ledger_sync/adaptors/quickbooks_online/util/adaptor_error_parser.rb', line 81 def initialize(adaptor:, error:) @adaptor = adaptor super(error: error) end |
Instance Attribute Details
#adaptor ⇒ Object (readonly)
Returns the value of attribute adaptor.
79 80 81 |
# File 'lib/ledger_sync/adaptors/quickbooks_online/util/adaptor_error_parser.rb', line 79 def adaptor @adaptor end |
Instance Method Details
#parse ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ledger_sync/adaptors/quickbooks_online/util/adaptor_error_parser.rb', line 86 def parse PARSERS.map do |parser| matcher = parser.new(error: error) next unless matcher.match? return matcher.error_klass.new( adaptor: adaptor, message: matcher., response: error ) end nil end |