Exception: Geocodio::Client::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Geocodio::Client::Error
- Defined in:
- lib/geocodio/client/error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object (also: #error)
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
6 7 8 |
# File 'lib/geocodio/client/error.rb', line 6 def initialize(response) @response, @json = response, JSON.parse(response.body) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/geocodio/client/error.rb', line 4 def response @response end |
Instance Method Details
#body ⇒ Object
10 |
# File 'lib/geocodio/client/error.rb', line 10 def body() @json end |
#message ⇒ Object Also known as: error
11 |
# File 'lib/geocodio/client/error.rb', line 11 def () body['error'] end |