Module: Lieu::Client::Autocomplete

Included in:
Lieu::Client
Defined in:
lib/lieu/client/autocomplete.rb

Overview

Methods for the Place Autocomplete API

Instance Method Summary collapse

Instance Method Details

#autocomplete(input, options = {}) ⇒ Array<Hashie::Mash>

Search a place.

Examples:

Lieu.autocomplete('Le Zenith Paris')

Parameters:

  • input (String)

    the search term

  • options (Hash) (defaults to: {})

    optional parameters

Returns:

  • (Array<Hashie::Mash>)

    a list of predicted places

See Also:



14
15
16
17
18
# File 'lib/lieu/client/autocomplete.rb', line 14

def autocomplete(input, options={})
  options.merge!(input: input)

  get('autocomplete', options).predictions
end