connect (Net::SFTP::Session)

    # File lib/net/sftp/session.rb, line 765
          def connect(&block)
            case state
            when :open
              block.call(self) if block
            when :closed
              @state = :opening
              @channel = session.open_channel(&method(:when_channel_confirmed))
              @packet_length = nil
              @protocol = nil
              @on_ready = Array(block)
            else # opening
              @on_ready << block if block
            end

            self
          end