Sha256: e0a5640d40cf2e49b425c83d233c9912f52728f55c1a4516a1d8770b196938fd

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 Bytes

Contents

require 'google_maps_apis/convert'

module GoogleMapsApis::Services

  # Performs requests to the Google Maps Geocoding API.
  module Places
    def places_autocomplete(input, components: nil, bounds: nil, types: nil, region: nil, language: nil)
      params = {}

      params[:input] = input
      params[:components] = GoogleMapsApis::Convert.components(components) if components
      params[:bounds] = GoogleMapsApis::Convert.bounds(bounds) if bounds
      params[:region] = region if region
      params[:language] = language if language
      params[:types] = types if types

      return get('/maps/api/place/autocomplete/json', params)[:predictions]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
google_maps_apis-1.0.1 lib/google_maps_apis/services/places.rb
google_maps_apis-1.0.0 lib/google_maps_apis/services/places.rb