Skip to content
Snippets Groups Projects
Commit b0324d2e authored by Alex Reisner's avatar Alex Reisner
Browse files

Rename method (Ruby convention, returns boolean).

parent 690ab192
No related branches found
No related tags found
No related merge requests found
......@@ -196,7 +196,7 @@ module Geocoder
"http" + (configuration.use_https ? "s" : "")
end
def valid_response(response)
def valid_response?(response)
(200..399).include?(response.code.to_i)
end
......@@ -212,7 +212,7 @@ module Geocoder
check_api_key_configuration!(query)
response = make_api_request(query)
body = response.body
if cache and valid_response(response)
if cache and valid_response?(response)
cache[key] = body
end
@cache_hit = false
......
......@@ -16,7 +16,7 @@ module Geocoder::Lookup
"#{protocol}://maps.googleapis.com/maps/api/geocode/json?" + url_query_string(query)
end
def valid_response(response)
def valid_response?(response)
status = parse_json(response.body)["status"]
super(response) and ['OK', 'ZERO_RESULTS'].include?(status)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment