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

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

Overview

A namespaced client for the /v1/shopping/hotels endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.shopping.hotels(123)

Defined Under Namespace

Classes: HotelOffers, Offer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hotel_id) ⇒ Hotel

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

Parameters:



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

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

Instance Attribute Details

#hotel_idObject (readonly)

the Hotel ID



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

def hotel_id
  @hotel_id
end

Instance Method Details

#hotel_offersAmadeus::Namespaces::Shopping::Hotels::HotelOffers

The namespace for the Hotels::HotelOffers API:

Examples:

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

Returns:

  • (Amadeus::Namespaces::Shopping::Hotels::HotelOffers)


48
49
50
51
52
# File 'lib/amadeus/namespaces/shopping/hotel.rb', line 48

def hotel_offers
  Amadeus::Namespaces::Shopping::Hotel::HotelOffers.new(
    client, @hotel_id
  )
end

#offer(offer_id) ⇒ Amadeus::Namespaces::Shopping::Hotels::Offers

The namespace for the Hotels::Offers API:

Examples:

amadeus.shopping.hotel('SMPARCOL').offer(234)

Parameters:

  • offer_id (Number)

    The ID for the offer to find details for

Returns:

  • (Amadeus::Namespaces::Shopping::Hotels::Offers)


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

def offer(offer_id)
  Amadeus::Namespaces::Shopping::Hotel::Offer.new(
    client, @hotel_id, offer_id
  )
end