Exception: Linketysplit::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Linketysplit::ApiError
- Defined in:
- lib/linketysplit/api_endpoints.rb
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(response) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(response) ⇒ ApiError
Returns a new instance of ApiError.
11 12 13 14 15 16 |
# File 'lib/linketysplit/api_endpoints.rb', line 11 def initialize(response) @status_code = response.code data = JSON.parse(response.body) = data["message"].is_a?(String) ? data["message"] : "An unknown error occurred" super() end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/linketysplit/api_endpoints.rb', line 9 def status_code @status_code end |