Sha256: 525f1a37964dbbaa904e1c85f3074c65589a75adb2f343e131fc14faabe4abed

Contents?: true

Size: 1004 Bytes

Versions: 2

Compression:

Stored size: 1004 Bytes

Contents

module YellowApi
  class Client
    module GetTypeAhead
      # The type ahead call returns search suggestions based on the characters a user has entered.
      # The user can select the suggested term, saving them from having to enter all the characters for their search term.
      #
      # @see http://www.yellowapi.com/docs/places/#gettypeahead
      # @rate_limited Yes
      # @reqires_authentication Yes
      #
      # @param text [String] Characters typed by user
      # @param field [Symbol] Which field to suggest, :what or :where
      # @param lang [String] Suggestion languages (en - English [default], fr - French)
      # @return {Hash}
      # @example
      #   YellowApi.get_type_ahead("au", :what)
      #   YellowApi.get_type_ahead("monc", :where, "fr")
      def get_type_ahead(text, field, lang = 'en')
        options = {
          text: text,
          lang: lang,
          field: field.to_s.upcase
        }
        get('/GetTypeAhead/', options)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yellow-api-wrapper-0.0.2 lib/yellow_api/client/get_type_ahead.rb
yellow-api-wrapper-0.0.1 lib/yellow_api/client/get_type_ahead.rb