Class: Amadeus::Namespaces::ReferenceData::Locations

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/reference_data/locations.rb,
lib/amadeus/namespaces/reference_data/locations/airports.rb

Overview

A namespaced client for the /v2/reference-data/locations endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.reference_data.locations

Defined Under Namespace

Classes: Airports

Instance Method Summary collapse

Instance Method Details

#airportsAmadeus::Namespaces::ReferenceData::Locations::Airports

The namespace for the Airports API:

Examples:

amadeus.reference_data.locations.airports

Returns:



21
22
23
# File 'lib/amadeus/namespaces/reference_data/locations.rb', line 21

def airports
  Amadeus::Namespaces::ReferenceData::Locations::Airports.new(client)
end

#get(params = {}) ⇒ Amadeus::Response

Returns a list of airports and cities matching a given keyword.

Examples:

Find any location starting with ‘lon’

amadeus.reference_data.locations.get(
  keyword: 'lon',
  subType: Amadeus::Location::ANY
)

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :keyword (String)

    keyword that should represent the start of a word in a city or airport name or code

  • :subType (String)

    the Location to search for

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



39
40
41
# File 'lib/amadeus/namespaces/reference_data/locations.rb', line 39

def get(params = {})
  client.get('/v1/reference-data/locations', params)
end