Sha256: 16abcdec2e98d912b03a1e4eb4e280fe593747fc58c473c0450d0d3800bfa164

Contents?: true

Size: 830 Bytes

Versions: 10

Compression:

Stored size: 830 Bytes

Contents

require "geocoder/lookups/google"
require "geocoder/results/google_places_details"

module Geocoder
  module Lookup
    class GooglePlacesDetails < Google
      def name
        "Google Places Details"
      end

      def required_api_key_parts
        ["key"]
      end

      def supported_protocols
        [:https]
      end

      private

      def base_query_url(query)
        "#{protocol}://maps.googleapis.com/maps/api/place/details/json?"
      end

      def result_root_attr
        'result'
      end

      def results(query)
        result = super(query)
        return [result] unless result.is_a? Array

        result
      end

      def query_url_google_params(query)
        {
          placeid: query.text,
          language: query.language || configuration.language
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
geocoder-1.7.5 lib/geocoder/lookups/google_places_details.rb
geocoder-1.7.4 lib/geocoder/lookups/google_places_details.rb
geocoder-1.7.3 lib/geocoder/lookups/google_places_details.rb
geocoder-1.7.2 lib/geocoder/lookups/google_places_details.rb
geocoder-1.7.1 lib/geocoder/lookups/google_places_details.rb
geocoder-1.7.0 lib/geocoder/lookups/google_places_details.rb
geocoder-1.6.7 lib/geocoder/lookups/google_places_details.rb
geocoder-1.6.6 lib/geocoder/lookups/google_places_details.rb
geocoder-1.6.5 lib/geocoder/lookups/google_places_details.rb
geocoder-1.6.4 lib/geocoder/lookups/google_places_details.rb