Exception: Holodex::ResourceError
- Inherits:
-
StandardError
- Object
- StandardError
- Holodex::ResourceError
- Defined in:
- lib/holodex/resource/error.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(http_code, data) ⇒ ResourceError
constructor
A new instance of ResourceError.
Constructor Details
#initialize(http_code, data) ⇒ ResourceError
5 6 7 8 9 |
# File 'lib/holodex/resource/error.rb', line 5 def initialize(http_code, data) @http_code = http_code @data = data super("Holodex returned an HTTP #@http_code with the following payload: #@data") end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/holodex/resource/error.rb', line 3 def data @data end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
3 4 5 |
# File 'lib/holodex/resource/error.rb', line 3 def http_code @http_code end |
Instance Method Details
#[](key) ⇒ Object
11 12 13 |
# File 'lib/holodex/resource/error.rb', line 11 def [](key) @data[key] end |