Class: Amadeus::Namespaces::Shopping::Hotel::Offer

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

Overview

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

Access via the Amadeus::Client object

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hotel_id, offer_id) ⇒ Offer

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

Parameters:



28
29
30
31
32
# File 'lib/amadeus/namespaces/shopping/hotel/offer.rb', line 28

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

Instance Attribute Details

#hotel_idObject (readonly)

the Hotel ID



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

def hotel_id
  @hotel_id
end

#offer_idObject (readonly)

the Offer ID



19
20
21
# File 'lib/amadeus/namespaces/shopping/hotel/offer.rb', line 19

def offer_id
  @offer_id
end

Instance Method Details

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

Get room and rate details

Examples:

Search for hotels in London

amadeus.shopping.hotel('SMPARCOL')
  .offers('AC7D4DA2C322A73AF0824318A4965DA2805A3FC2').get

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



42
43
44
45
46
# File 'lib/amadeus/namespaces/shopping/hotel/offer.rb', line 42

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