def connect(options) #:nodoc:
      options_pattern = { :database => :mandatory, :user => :mandatory, :password => :mandatory }
      verify_and_sanitize_options(options, options_pattern)

      @database = options[:database]
      @user = options[:user]
      @password = options[:password]

      @nodes.each { |node| node.cleanup } # destroy all used session <= problem in 1.3.0-SNAPSHOT
      begin
        http_response = call_server(:method => :get, :uri => "connect/#{@database}")
      rescue
        @connected = false
        @user = nil
        @password = nil
        @database = nil
        @nodes.each { |node| node.cleanup }
        raise ConnectionError
      end

      rslt = process_response http_response
      # no metadata in connect v1.4.0+
      # https://groups.google.com/forum/?fromgroups=#!topic/orient-database/R0VoOfIyDng
      #decorate_classes_with_model(rslt['classes']) unless rslt['classes'].nil?

      if @connection_library == :excon
        Orientdb4r::logger.info "successfully connected to server, code=#{http_response.code}"
      else
        Orientdb4r::logger.info "successfully connected to server, code=#{rslt.code}"
      end

      @connected = true
      @connected
    end
def connect(options) #:nodoc:
      options_pattern = { :database => :mandatory, :user => :mandatory, :password => :mandatory }
      verify_and_sanitize_options(options, options_pattern)

      @database = options[:database]
      @user = options[:user]
      @password = options[:password]

      @nodes.each { |node| node.cleanup } # destroy all used session <= problem in 1.3.0-SNAPSHOT
      begin
        http_response = call_server(:method => :get, :uri => "connect/#{@database}")
      rescue
        @connected = false
        @user = nil
        @password = nil
        @database = nil
        @nodes.each { |node| node.cleanup }
        raise ConnectionError
      end

      rslt = process_response http_response
      # no metadata in connect v1.4.0+
      # https://groups.google.com/forum/?fromgroups=#!topic/orient-database/R0VoOfIyDng
      #decorate_classes_with_model(rslt['classes']) unless rslt['classes'].nil?

      if @connection_library == :excon
        Orientdb4r::logger.info "successfully connected to server, code=#{http_response.code}"
      else
        Orientdb4r::logger.info "successfully connected to server, code=#{rslt.code}"
      end

      @connected = true
      @connected
    end
--------------------------------------------------------------- CONNECTION