class GmapsTz::Error
Attributes
body[RW]
uri[RW]
Public Class Methods
from_json(uri, json)
click to toggle source
# File lib/gmaps_tz/error.rb, line 3 def self.from_json(uri, json) klass = case json["status"] when "INVALID_REQUEST" InvalidRequestError when "OVER_QUERY_LIMIT" OverQueryLimitError when "REQUEST_DENIED" RequestDeniedError when "UNKNOWN_ERROR" UnknownError when "ZERO_RESULTS" ZeroResultsError else UnexpectedResponseError end klass.new(uri, json) end
new(uri, body)
click to toggle source
# File lib/gmaps_tz/error.rb, line 23 def initialize(uri, body) @uri = uri @body = body end