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



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

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

  query_data = {:key=>api_key,:query=>query, :location=>location,:radius=>radius}
  response = HTTParty.get("#{url}", :query=>query_data)

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