Exception: Geocodio::Client::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/geocodio/client/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (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

#bodyObject


10
# File 'lib/geocodio/client/error.rb', line 10

def body() @json end

#messageObject Also known as: error


11
# File 'lib/geocodio/client/error.rb', line 11

def message() body['error'] end