def connect(args = {})
      args[:no_port_specified] = args[:port].to_s.empty?
      args = apply_connection_defaults args

      # ensure an integer
      args[:port] &&= args[:port].to_i

      # confirm we know basics
      verify_basic_args args

      # parse our ssl situation
      verify_ssl args

      @user = args[:user]

      @rest_url = build_rest_url args

      # figure out :password from :pw
      args[:password] = acquire_password args

      # heres our connection
      @cnx = RestClient::Resource.new(@rest_url.to_s, args)

      verify_server_version

      @name = "#{@user}@#{@server_host}:#{@port}" if @name.nil? || @name == :disconnected
      @connected ? hostname : nil
    end
def connect(args = {})
      args[:no_port_specified] = args[:port].to_s.empty?
      args = apply_connection_defaults args

      # ensure an integer
      args[:port] &&= args[:port].to_i

      # confirm we know basics
      verify_basic_args args

      # parse our ssl situation
      verify_ssl args

      @user = args[:user]

      @rest_url = build_rest_url args

      # figure out :password from :pw
      args[:password] = acquire_password args

      # heres our connection
      @cnx = RestClient::Resource.new(@rest_url.to_s, args)

      verify_server_version

      @name = "#{@user}@#{@server_host}:#{@port}" if @name.nil? || @name == :disconnected
      @connected ? hostname : nil
    end
Constructor

 If name: is provided (as a String or Symbol) that will be
 stored as the APIConnection's name attribute.

 For other available parameters, see {#connect}.

 If they are provided, they will be used to establish the
 connection immediately.

 If not, you must call {#connect} before accessing the API.

 init
 Instance Methods

 Connect to the JSS Classic API.

 @param args[Hash] the keyed arguments for connection.

 @option args :server[String] the hostname of the JSS API server, required if not defined in JSS::CONFIG

 @option args :server_path[String] If your JSS is not at the root of the server, e.g.
   if it's at
     https://myjss.myserver.edu:8443/dev_mgmt/jssweb
   rather than
     https://myjss.myserver.edu:8443/
   then use this parameter to specify the path below the root e.g:
     server_path: 'dev_mgmt/jssweb'

 @option args :port[Integer] the port number to connect with, defaults to 8443

 @option args :use_ssl[Boolean] should the connection be made over SSL? Defaults to true.

 @option args :verify_cert[Boolean] should HTTPS SSL certificates be verified. Defaults to true.
   If your connection raises RestClient::SSLCertificateNotVerified, and you don't care about the
   validity of the SSL cert. just set this explicitly to false.

 @option args :user[String] a JSS user who has API privs, required if not defined in JSS::CONFIG

 @option args :pw[String,Symbol] Required, the password for that user, or :prompt, or :stdin
   If :prompt, the user is promted on the commandline to enter the password for the :user.
   If :stdin#, the password is read from a line of std in represented by the digit at #,
   so :stdin3 reads the passwd from the third line of standard input. defaults to line 1,
   if no digit is supplied. see {JSS.stdin}

 @option args :open_timeout[Integer] the number of seconds to wait for an initial response, defaults to 60

 @option args :timeout[Integer] the number of seconds before an API call times out, defaults to 60

 @return [true]