Class: LevelTravel::Search::Request
- Inherits:
-
Object
- Object
- LevelTravel::Search::Request
- Defined in:
- lib/level_travel/search/request.rb
Class Method Summary collapse
- .actualize(request_id, tour_id:) ⇒ Object
- .enqueue(search_params) ⇒ Object
- .get_grouped_hotels(request_id, operator_ids: []) ⇒ Object
-
.get_hotel_offers(request_id, hotel_id:, operator_ids: [], compact: false) ⇒ Object
:reek:BooleanParameter :reek:LongParameterList.
- .get_offer(request_id, tour_id:, from_package: nil) ⇒ Object
- .status(request_id) ⇒ Object
Class Method Details
.actualize(request_id, tour_id:) ⇒ Object
39 40 41 |
# File 'lib/level_travel/search/request.rb', line 39 def self.actualize(request_id, tour_id:) ::LevelTravel::Request.get('/search/actualize', request_id: request_id, tour_id: tour_id) end |
.enqueue(search_params) ⇒ Object
7 8 9 |
# File 'lib/level_travel/search/request.rb', line 7 def self.enqueue(search_params) ::LevelTravel::Request.get('/search/enqueue', search_params.to_h) end |
.get_grouped_hotels(request_id, operator_ids: []) ⇒ Object
19 20 21 22 23 |
# File 'lib/level_travel/search/request.rb', line 19 def self.get_grouped_hotels(request_id, operator_ids: []) params = prepare_params(operator_ids: operator_ids) ::LevelTravel::Request.get('/search/get_grouped_hotels', request_id: request_id, **params) end |
.get_hotel_offers(request_id, hotel_id:, operator_ids: [], compact: false) ⇒ Object
:reek:BooleanParameter :reek:LongParameterList
31 32 33 34 35 |
# File 'lib/level_travel/search/request.rb', line 31 def self.get_hotel_offers(request_id, hotel_id:, operator_ids: [], compact: false) params = prepare_params(operator_ids: operator_ids, compact: compact) ::LevelTravel::Request.get('/search/get_hotel_offers', request_id: request_id, hotel_id: hotel_id, **params) end |
.get_offer(request_id, tour_id:, from_package: nil) ⇒ Object
46 47 48 49 |
# File 'lib/level_travel/search/request.rb', line 46 def self.get_offer(request_id, tour_id:, from_package: nil) params = from_package ? { from_package: from_package } : {} ::LevelTravel::Request.get('/search/get_offer', request_id: request_id, tour_id: tour_id, **params) end |
.status(request_id) ⇒ Object
12 13 14 15 |
# File 'lib/level_travel/search/request.rb', line 12 def self.status(request_id) # TODO: return an object like { succeeded: [], failed: [] } ::LevelTravel::Request.get('/search/status', request_id: request_id) end |