Class: Amadeus::Namespaces::Shopping::Hotel::HotelOffers

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb

Overview

A namespaced client for the /v1/shopping/hotels/:id/hotel-offers endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.shopping.hotels.hotel_offers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hotel_id) ⇒ HotelOffers

Initialize this namespaced client with an Client instance and a Hotel ID

Parameters:



25
26
27
28
# File 'lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb', line 25

def initialize(client, hotel_id)
  super(client)
  @hotel_id = hotel_id
end

Instance Attribute Details

#hotel_idObject (readonly)

the Hotel ID



17
18
19
# File 'lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb', line 17

def hotel_id
  @hotel_id
end

Instance Method Details

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

Get one hotel and its available offers

Examples:

Search for hotels in London

amadeus.shopping.hotel('SMPARCOL').hotel_offers.get

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



37
38
39
# File 'lib/amadeus/namespaces/shopping/hotel/hotel_offers.rb', line 37

def get(params = {})
  client.get("/v1/shopping/hotels/#{@hotel_id}/hotel-offers", params)
end