Exception: Suitcase::Hotel::EANException
- Inherits:
-
Exception
- Object
- Exception
- Suitcase::Hotel::EANException
- Defined in:
- lib/suitcase/hotel/ean_exception.rb
Overview
Public: An Exception to be raised from all EAN API-related errors.
Instance Attribute Summary collapse
-
#recovery ⇒ Object
Public: Getter for the recovery information.
-
#type ⇒ Object
Public: Getter for the error type..
Instance Method Summary collapse
-
#initialize(message, type = nil) ⇒ EANException
constructor
Internal: Create a new EAN exception.
-
#recoverable? ⇒ Boolean
Public: Check if the error is recoverable.
Constructor Details
#initialize(message, type = nil) ⇒ EANException
Internal: Create a new EAN exception.
message - The String error message returned by the API. type - The Symbol type of the error.
21 22 23 24 |
# File 'lib/suitcase/hotel/ean_exception.rb', line 21 def initialize(, type = nil) @type = type super() end |
Instance Attribute Details
#recovery ⇒ Object
Public: Getter for the recovery information.
9 10 11 |
# File 'lib/suitcase/hotel/ean_exception.rb', line 9 def recovery @recovery end |
#type ⇒ Object
Public: Getter for the error type..
15 16 17 |
# File 'lib/suitcase/hotel/ean_exception.rb', line 15 def type @type end |
Instance Method Details
#recoverable? ⇒ Boolean
Public: Check if the error is recoverable. If it is, recovery information
is in the attribute recovery.
Returns a Boolean based on whether the error is recoverable.
30 31 32 |
# File 'lib/suitcase/hotel/ean_exception.rb', line 30 def recoverable? @recovery.is_a?(Hash) end |