Class: GooglePlaceTextSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/google_place_text_search.rb

Instance Method Summary collapse

Instance Method Details

#get_response(api_key, radius, location, query) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/google_place_text_search.rb', line 6

def get_response(api_key,radius,location,query)
  url = "https://maps.googleapis.com/maps/api/place/textsearch/json"
  #location="#{lat},#{lng}"
  response = HTTParty.get("#{url}", :query=>{:api_key=>api_key,:query=>query, :location=>location,:radius=>radius})

json = JSON.parse(response.body)
  return json
end