Class: GoogleMapsJuice::Endpoint::Response

Inherits:
Hash
  • Object
show all
Defined in:
lib/google_maps_juice/endpoint.rb

Instance Method Summary collapse

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/google_maps_juice/endpoint.rb', line 63

def error?
  status.upcase != 'OK'
end

#error_messageObject



75
76
77
# File 'lib/google_maps_juice/endpoint.rb', line 75

def error_message
  self['error_message']
end

#limit_error?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/google_maps_juice/endpoint.rb', line 71

def limit_error?
  %w( OVER_DAILY_LIMIT OVER_QUERY_LIMIT ).include?(status.upcase)
end

#resultsObject



79
80
81
# File 'lib/google_maps_juice/endpoint.rb', line 79

def results
  self['results']
end

#statusObject



59
60
61
# File 'lib/google_maps_juice/endpoint.rb', line 59

def status
  self['status']
end

#zero_results?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/google_maps_juice/endpoint.rb', line 67

def zero_results?
  status.upcase == 'ZERO_RESULTS'
end