Exception: KpApi::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- KpApi::ApiError
- Defined in:
- lib/kp_api/api_error.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
-
#initialize(message, data) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, data) ⇒ ApiError
Returns a new instance of ApiError.
4 5 6 7 |
# File 'lib/kp_api/api_error.rb', line 4 def initialize(, data) super() @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/kp_api/api_error.rb', line 8 def data @data end |
Instance Method Details
#body ⇒ Object
14 15 16 |
# File 'lib/kp_api/api_error.rb', line 14 def body @data[:body] end |
#code ⇒ Object
10 11 12 |
# File 'lib/kp_api/api_error.rb', line 10 def code @data[:code] end |