lib/jamf/api/connection/attributes.rb in ruby-jss-2.1.0b5 vs lib/jamf/api/connection/attributes.rb in ruby-jss-2.1.0

- old
+ new

@@ -72,19 +72,19 @@ # @return [Boolean] are we using a sticky session? attr_reader :sticky_session alias sticky_session? sticky_session alias sticky? sticky_session - + # @return [String, nil] The current sticky_session cookie. nil unless # sticky_session is set to true, either as a param to 'connect' or via # #sticky_session= # - # When set via .connect, the cookie is gleaned from the token creation + # When set via .connect, the cookie is gleaned from the token creation # reponse. When set via #sticky_session=, a HEAD request is made, and the # cookie will be in the response. - # + # # Only valid when the connection is to a Jamf Cloud server. attr_reader :sticky_session_cookie ########################################## @@ -98,11 +98,11 @@ def sticky_session=(value) @sticky_session ||= false # convert boolean-y to boolean value = value ? true : false - + return if @sticky_session == value if value raise Jamf::UnsupportedError, 'Sticky Sessions may only be used with Jamf Cloud servers.' unless host.end_with? Jamf::Connection::JAMFCLOUD_DOMAIN @@ -123,23 +123,23 @@ # # @return [void] # def timeout=(new_timeout) @timeout = new_timeout.to_i - @c_cnx&.options[:timeout] = @timeout - @jp_cnx&.options[:timeout] = @timeout + @c_cnx.options.timeout = @timeout if @c_cnx + @jp_cnx.options.timeout = @timeout if @jp_cnx end # Reset the open-connection timeout for the rest connection # # @param timeout[Integer] the new timeout in seconds # # @return [void] # def open_timeout=(new_timeout) @open_timeout = new_timeout.to_i - @c_cnx&.options[:open_timeout] = @open_timeout - @jp_cnx&.options[:open_timeout] = @open_timeout + @c_cnx.options.open_timeout = @open_timeout if @c_cnx + @jp_cnx.options.open_timeout = @open_timeout if @jp_cnx end # @return [URI::HTTPS] the base URL to the server def base_url validate_token