Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No memoization though

  • Loading branch information...
commit 08144dbff75c9ab8eac1fba6d97f4ae786aa5b78 1 parent f9db8eb
Greg Sterndale gsterndale authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/stumble_score/location.rb
6 lib/stumble_score/location.rb
View
@@ -32,7 +32,6 @@ def bar_names
end
def bars
- return @bars if @bars
uri = URI::HTTPS.build({
:host => "maps.googleapis.com",
:path => "/maps/api/place/search/json",
@@ -43,11 +42,10 @@ def bars
"key=#{GOOGLE_KEY}"
})
parsed = self.ask_the_google(uri)
- @bars = parsed["results"]
+ parsed["results"]
end
def geocode
- return @geocode if @geocode
escaped_address = URI.escape(@address)
uri = URI::HTTPS.build({
:host => "maps.googleapis.com",
@@ -57,7 +55,7 @@ def geocode
})
parsed = self.ask_the_google(uri)
location = parsed["results"][0]["geometry"]["location"]
- @geocode = "#{location["lat"]},#{location["lng"]}"
+ "#{location["lat"]},#{location["lng"]}"
end
def ask_the_google(uri)
Please sign in to comment.
Something went wrong with that request. Please try again.