lib/expedia/http_service.rb in expedia-0.0.4 vs lib/expedia/http_service.rb in expedia-0.0.5

- old
+ new

@@ -3,12 +3,12 @@ module Expedia module HTTPService API_SERVER = 'api.eancdn.com' + DEVELOPMENT_API_SERVER = 'dev.api.ean.com' RESERVATION_SERVER = 'book.api.ean.com' - DEVELOPMENT_SERVER = 'dev.api.ean.com' class << self # The address of the appropriate Expedia server. @@ -18,11 +18,11 @@ # @option options :use_ssl force https, even if not needed # # @return a complete server address with protocol def server(options = {}) if Expedia.cid.to_i == 55505 && !options[:reservation_api] - server = DEVELOPMENT_SERVER + server = DEVELOPMENT_API_SERVER else server = options[:reservation_api] ? RESERVATION_SERVER : API_SERVER end "#{options[:use_ssl] ? "https" : "http"}://#{server}" end @@ -35,11 +35,11 @@ # @param conn - Faraday connection object # # @return the connection obj with the timeouts set if they have been initialized def add_timeouts(conn, options) if !options[:ignore_timeout] - conn.options.timeout = Expedia.timeout.to_i if Expedia.timeout.present? - conn.options.open_timeout = Expedia.open_timeout.to_i if Expedia.open_timeout.present? + conn.options.timeout = Expedia.timeout.to_i if Expedia.timeout + conn.options.open_timeout = Expedia.open_timeout.to_i if Expedia.open_timeout end conn end # Makes a request directly to Expedia.