Exception: CoinMarketCap::Errors::ClientError
- Inherits:
-
StandardError
- Object
- StandardError
- CoinMarketCap::Errors::ClientError
- Defined in:
- lib/coinmarketcap/errors/client_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
- #error ⇒ Object
-
#initialize(response) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(response) ⇒ ClientError
Returns a new instance of ClientError.
6 7 8 9 |
# File 'lib/coinmarketcap/errors/client_error.rb', line 6 def initialize(response) @response = response super error end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/coinmarketcap/errors/client_error.rb', line 4 def response @response end |
Instance Method Details
#body ⇒ Object
19 20 21 |
# File 'lib/coinmarketcap/errors/client_error.rb', line 19 def body response[:body] end |
#error ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/coinmarketcap/errors/client_error.rb', line 11 def error if body.is_a?(Hash) && body.key?('error') body['error'] else body end end |