Class: Amadeus::Namespaces::ReferenceData::Location

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

Overview

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

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.reference_data.locations('ALHR')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, location_id = nil) ⇒ Location

Initialize this namespaced client with an Client instance and an optional Location ID

Parameters:



24
25
26
27
# File 'lib/amadeus/namespaces/reference_data/location.rb', line 24

def initialize(client, location_id = nil)
  super(client)
  @location_id = location_id
end

Instance Attribute Details

#location_idObject (readonly)

the Location ID



16
17
18
# File 'lib/amadeus/namespaces/reference_data/location.rb', line 16

def location_id
  @location_id
end

Instance Method Details

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

Returns details for a specific airport

Examples:

Find details for London Heathrow

amadeus.reference_data.locations('ALHR').get

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



36
37
38
# File 'lib/amadeus/namespaces/reference_data/location.rb', line 36

def get(params = {})
  client.get("/v1/reference-data/locations/#{@location_id}", params)
end