lib/gmaps_tz/client.rb in gmaps_tz-0.0.1 vs lib/gmaps_tz/client.rb in gmaps_tz-0.0.2
- old
+ new
@@ -17,16 +17,11 @@
@basic_params[:key] = options[:key] if options[:key]
end
def get(path, query_params)
uri = generate_uri(path, query_params)
-
response = Net::HTTP.get_response(uri)
- if JSON.parse(response.body)["status"] == "OK"
- response
- else
- raise Error.from_response(uri, response)
- end
+ ResponseParser.new(uri, response).execute
end
private
def generate_uri(path, query_params)
\ No newline at end of file