Class: BookingApi::Client
- Inherits:
-
Object
- Object
- BookingApi::Client
- Defined in:
- lib/booking_api/client.rb
Instance Method Summary collapse
- #get_hotel_availabillity(request_parameters: {}) ⇒ Object
- #get_hotel_description_translations(request_parameters: {}) ⇒ Object
- #hotel_description_photos(hotel_ids: [], request_parameters: {}) ⇒ Object
- #http_service ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
4 5 6 |
# File 'lib/booking_api/client.rb', line 4 def initialize @http_service = HttpService.new end |
Instance Method Details
#get_hotel_availabillity(request_parameters: {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/booking_api/client.rb', line 12 def get_hotel_availabillity(request_parameters: {}) default_parameters = { room1: "A,A", } http_service.request_post("/json/getHotelAvailabilityV2", default_parameters.merge(request_parameters)) end |
#get_hotel_description_translations(request_parameters: {}) ⇒ Object
28 29 30 31 |
# File 'lib/booking_api/client.rb', line 28 def get_hotel_description_translations(request_parameters: {}) default_parameters = {} http_service.request_post("/json/bookings.getHotelDescriptionTranslations", default_parameters.merge(request_parameters)) end |
#hotel_description_photos(hotel_ids: [], request_parameters: {}) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/booking_api/client.rb', line 19 def hotel_description_photos(hotel_ids: [], request_parameters: {}) raise ArgumentError if hotel_ids.empty? default_parameters = { hotel_ids: hotel_ids.join(",") } response = http_service.request_post("/json/bookings.getHotelDescriptionPhotos", default_parameters.merge(request_parameters)) Images::ResponseList.new(response) end |
#http_service ⇒ Object
8 9 10 |
# File 'lib/booking_api/client.rb', line 8 def http_service @http_service end |