     obj.included?.apply(@)
     this
   
-  @optimizeSettings: (settings) ->
-    # settings is a string, dsn coded e.g. http://localhost:8529/ConnectorTest
-    if typeof settings is 'string'
-      url_obj = url.parse settings
-    
-      
-      database = url_obj.pathname[1..].split('/')[0]
-      delete url_obj.path
-      delete url_obj.pathname
-      url_obj.protocol = 'http:'
-      url_obj.slashes = true
-    
-      url = url.format url_obj
-      databaseName = database
-    else
-      user = settings.user or settings.username or null
-      pass = settings.pass or settings.password or null
-      auth = if user and pass then "#{user}:#{pass}" else null
-    
-      host = settings.host or 'localhost'
-      port = settings.port or 8529
-      hostname = "#{host}:#{port}"
-    
-      url = if auth? then "http://#{auth}@#{hostname}" else "http://#{hostname}"
-      database = settings.database or settings.db or '_system'
-      
-    
-    return {
-      url: url
-      databaseName: database
-      promise: false
-    }
-  
-  
-  
-  
   ###
     The constructor for ArangoDB connector
+    @constructor
 
     @param dataSource [Object] Object to connect this connector to a data source
     @option settings host [String] The host/ip address to connect with

  
  @author Navid Nikpour
###
class ArangoDBConnector
  @extend: (obj) ->
    for key, value of obj when key not in ['extended', 'included']
      @[key] = value

url = require 'url'

# ArangoDB Query Builder
ajs = require 'arangojs'
qb = require 'aqb'

debug = require('debug') 'loopback:connector:arango'
