Class: ShellSmartPayApi::MppAccesTokenErrorResponseException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- ShellSmartPayApi::MppAccesTokenErrorResponseException
- Defined in:
- lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb
Overview
MppAccesTokenErrorResponse class.
Instance Attribute Summary collapse
-
#error ⇒ String
error code or short description.
-
#error_code ⇒ String
error code or short description due to invalid request or invalid client ID.
-
#error_description ⇒ String
Description of the error.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ MppAccesTokenErrorResponseException
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ MppAccesTokenErrorResponseException
The constructor.
28 29 30 31 32 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 28 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#error ⇒ String
error code or short description
14 15 16 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 14 def error @error end |
#error_code ⇒ String
error code or short description due to invalid request or invalid client ID
19 20 21 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 19 def error_code @error_code end |
#error_description ⇒ String
Description of the error
23 24 25 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 23 def error_description @error_description end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
52 53 54 55 56 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 52 def inspect class_name = self.class.name.split('::').last "<#{class_name} error: #{@error.inspect}, error_code: #{@error_code.inspect},"\ " error_description: #{@error_description.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
45 46 47 48 49 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 45 def to_s class_name = self.class.name.split('::').last "<#{class_name} error: #{@error}, error_code: #{@error_code}, error_description:"\ " #{@error_description}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
37 38 39 40 41 42 |
# File 'lib/shell_smart_pay_api/exceptions/mpp_acces_token_error_response_exception.rb', line 37 def unbox(hash) @error = hash.key?('error') ? hash['error'] : nil @error_code = hash.key?('error_code') ? hash['error_code'] : nil @error_description = hash.key?('error_description') ? hash['error_description'] : SKIP end |