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

Rename raw_response to fetch_data.

parent 1a6c052b
No related branches found
No related tags found
No related merge requests found
...@@ -47,16 +47,16 @@ module Geocoder ...@@ -47,16 +47,16 @@ module Geocoder
# Returns nil if non-200 HTTP response, timeout, or other error. # Returns nil if non-200 HTTP response, timeout, or other error.
# #
def parsed_response(query, reverse = false) def parsed_response(query, reverse = false)
if doc = raw_response(query, reverse) if doc = fetch_data(query, reverse)
doc = ActiveSupport::JSON.decode(doc) doc = ActiveSupport::JSON.decode(doc)
doc && doc['status'] == "OK" ? doc : nil doc && doc['status'] == "OK" ? doc : nil
end end
end end
## ##
# Returns a raw Google geocoder search result (JSON). # Fetches a raw Google geocoder search result (JSON string).
# #
def raw_response(query, reverse = false) def fetch_data(query, reverse = false)
return nil if query.blank? return nil if query.blank?
url = query_url(query, reverse) url = query_url(query, reverse)
begin begin
......
...@@ -41,7 +41,7 @@ module Geocoder ...@@ -41,7 +41,7 @@ module Geocoder
module Lookup module Lookup
extend self extend self
private #----------------------------------------------------------------- private #-----------------------------------------------------------------
def raw_response(query, reverse = false) def fetch_data(query, reverse = false)
File.read(File.join("test", "fixtures", "madison_square_garden.json")) File.read(File.join("test", "fixtures", "madison_square_garden.json"))
end end
end 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