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,
lib/amadeus/namespaces/reference_data/locations/point_of_interest.rb,
lib/amadeus/namespaces/reference_data/locations/points_of_interest.rb,
lib/amadeus/namespaces/reference_data/locations/points_of_interest/by_square.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, PointOfInterest, PointsOfInterest

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



61
62
63
# File 'lib/amadeus/namespaces/reference_data/locations.rb', line 61

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

#point_of_interest(location_id) ⇒ Amadeus::Namespaces::ReferenceData::Locations::PointOfInterest

The namespace for the Point Of Interest API:

Examples:

amadeus.reference_data.locations.point_of_interest

Returns:



41
42
43
44
45
# File 'lib/amadeus/namespaces/reference_data/locations.rb', line 41

def point_of_interest(location_id)
  Amadeus::Namespaces::ReferenceData::Locations::PointOfInterest.new(
    client, location_id
  )
end

#points_of_interestAmadeus::Namespaces::ReferenceData::Locations::PointsOfInterest

The namespace for the Points Of Interest API:

Examples:

amadeus.reference_data.locations.points_of_interest

Returns:



31
32
33
# File 'lib/amadeus/namespaces/reference_data/locations.rb', line 31

def points_of_interest
  Amadeus::Namespaces::ReferenceData::Locations::PointsOfInterest.new(client)
end