 class window.PinkmanPath extends Pinkman.object
    
   constructor: (url) ->
-    # setting params
-    paramsRegex = /\?.*/
-    if paramsRegex.test(url)
-      paramsString = /\?(.*)/.exec(url)[1]
-      @query = JSON.parse('{"' + decodeURI(paramsString).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
-      url = url.replace("?#{paramsString}", '')
-      
     if PinkmanCache.has("p-path-#{url}")
       return(PinkmanCache.get("p-path-#{url}"))
     else
+      # setting params
+      paramsRegex = /\?.*/
+      if paramsRegex.test(url)
+        paramsString = /\?(.*)/.exec(url)[1]
+        @query = JSON.parse('{"' + decodeURI(paramsString).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
+        url = url.replace("?#{paramsString}", '')
+      
+      
       @levels = new Pinkman.collection
       @static = new Pinkman.collection
       @dynamic = new Pinkman.collection

  
  setup: (route,url) ->
    if route? and url?
      urlPath = new PinkmanPath(url) 
      route.path.matchParams(urlPath)
      @set('url',url)

    @levels.last()
  
  match: (path) ->
    # console.log "PinkmanPath#match - path arg: #{path}"
    path = new PinkmanPath(path) if Pinkman.isString(path)
    if PinkmanPath.isInstance(path) and path.depth == @depth
      # console.log 'tentou'
