lib/expedia/api.rb in expedia-0.0.3 vs lib/expedia/api.rb in expedia-0.0.4

- old
+ new

@@ -4,15 +4,13 @@ # @param args [Hash] All the params required for 'get_list' call # @return [Expedia::HTTPService::Response] on success. A response object representing the results from Expedia # @return [Expedia::APIError] on Error. - # @note A POST request is made instead of GET if 'numberOfResults' > 200 + # @note A POST request is made instead of GET if 'hotelIdList' length > 200 def get_list(args) - no_of_results = 'numberOfResults' - method = (args[no_of_results.to_sym].to_i > 200 || args[no_of_results].to_i > 200) || - args[no_of_results.downcase.to_sym].to_i > 200 || args[no_of_results.downcase].to_i > 200 ? :post : :get + method = (args[:hotelIdList] || args["hotelIdList"] || []).length > 200 ? :post : :get services('/ean-services/rs/hotel/v3/list', args, method) end def geo_search(args) services('/ean-services/rs/hotel/v3/geoSearch', args) @@ -41,10 +39,10 @@ def get_alternate_properties(args) services('/ean-services/rs/hotel/v3/altProps', args) end def get_reservation(args) - HTTPService.make_request('/ean-services/rs/hotel/v3/res', args, :post, { :reservation_api => true, :use_ssl => true }) + HTTPService.make_request('/ean-services/rs/hotel/v3/res', args, :post, { :reservation_api => true, :use_ssl => true, :ignore_timeout => true }) end def get_payment_info(args) services('/ean-services/rs/hotel/v3/paymentInfo', args) end