Exception: GoogleMapsGeocoder::GeocodingError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/google_maps_geocoder/google_maps_geocoder.rb

Overview

A geocoding error returned by Google Maps.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json = {}) ⇒ GeocodingError

Initialize a GeocodingError wrapping the JSON returned by Google Maps.

Parameters:

  • json (Hash) (defaults to: {})

    Google Maps’ JSON response



126
127
128
129
130
131
132
# File 'lib/google_maps_geocoder/google_maps_geocoder.rb', line 126

def initialize(json = {})
  @json = json
  if (message = @json['error_message'])
    Logger.new($stderr).error(message)
  end
  super @json
end

Instance Attribute Details

#jsonHash (readonly)

Returns the complete JSON response from Google Maps as a Hash.

Examples:

{
  "results" => [],
  "status" => "ZERO_RESULTS"
}

Returns:

  • (Hash)

    Google Maps’ JSON response



120
121
122
# File 'lib/google_maps_geocoder/google_maps_geocoder.rb', line 120

def json
  @json
end