Class: PscbIntegration::BaseApiError
- Inherits:
-
Object
- Object
- PscbIntegration::BaseApiError
- Defined in:
- lib/pscb_integration/base_api_error.rb
Direct Known Subclasses
Constant Summary collapse
- ERROR_CODES =
{ timeout: 'timeout error', connection_failed: 'connection failed error', }.freeze
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
Instance Method Summary collapse
- #connection_failed? ⇒ Boolean
-
#initialize(error_code) ⇒ BaseApiError
constructor
A new instance of BaseApiError.
- #message ⇒ Object
- #timeout? ⇒ Boolean
- #to_s ⇒ Object
- #unknown_payment? ⇒ Boolean
Constructor Details
#initialize(error_code) ⇒ BaseApiError
Returns a new instance of BaseApiError.
10 11 12 |
# File 'lib/pscb_integration/base_api_error.rb', line 10 def initialize(error_code) @error_code = error_code end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
8 9 10 |
# File 'lib/pscb_integration/base_api_error.rb', line 8 def error_code @error_code end |
Instance Method Details
#connection_failed? ⇒ Boolean
26 27 28 |
# File 'lib/pscb_integration/base_api_error.rb', line 26 def connection_failed? :connection_failed == error_code end |
#message ⇒ Object
18 19 20 |
# File 'lib/pscb_integration/base_api_error.rb', line 18 def to_s end |
#timeout? ⇒ Boolean
22 23 24 |
# File 'lib/pscb_integration/base_api_error.rb', line 22 def timeout? :timeout == error_code end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/pscb_integration/base_api_error.rb', line 14 def to_s ERROR_CODES[error_code] end |
#unknown_payment? ⇒ Boolean
30 31 32 |
# File 'lib/pscb_integration/base_api_error.rb', line 30 def unknown_payment? false end |