Class: GooglePlaceTextSearch

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

Constant Summary collapse

TEXT_SEARCH_URL =
"https://maps.googleapis.com/maps/api/place/textsearch/json"
VERSION =
"1.1.1"

Instance Method Summary collapse

Instance Method Details

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



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

def get_response(api_key, radius, location, query)
  warn "[DEPRECATION] google-place-text-search: This gem uses the legacy Google Places API " \
       "(deprecated March 2025). Please migrate to google-api-customization which will support " \
       "the new Places API v1."
  query_data = { key: api_key, query: query, location: location, radius: radius }
  response = HTTParty.get(TEXT_SEARCH_URL, query: query_data)
  JSON.parse(response.body)
end