def match(env)
      self.routes.each do |info|
        
        # If the route didn't specify method(s) to limit by, then all HTTP methods are valid.
        # If the route specified method(s), we check the request's HTTP method and validate
        # that it exists in that list.
        next unless info[:methods].nil? or info[:methods].include?(env["REQUEST_METHOD"].downcase.to_sym)
        
        match = env['PATH_INFO'].match(info[:regex])

        # See if a route matches
        if not match.nil?

          # Map any parameters in our matched string
          vars = {}
          
          info[:vars].each_index do |i|
            var = info[:vars][i]
            vars[var] = match[i+1]
          end

          return {:ok => vars.merge!(info[:hash]) }
        end
      end
      
      {:error => :not_found}
    end
def match(env)
      self.routes.each do |info|
        
        # If the route didn't specify method(s) to limit by, then all HTTP methods are valid.
        # If the route specified method(s), we check the request's HTTP method and validate
        # that it exists in that list.
        next unless info[:methods].nil? or info[:methods].include?(env["REQUEST_METHOD"].downcase.to_sym)
        
        match = env['PATH_INFO'].match(info[:regex])

        # See if a route matches
        if not match.nil?

          # Map any parameters in our matched string
          vars = {}
          
          info[:vars].each_index do |i|
            var = info[:vars][i]
            vars[var] = match[i+1]
          end

          return {:ok => vars.merge!(info[:hash]) }
        end
      end
      
      {:error => :not_found}
    end
Searches the routes for a match given a Rack env.

 {#match} looks in the {#routes} to find a match.

 This method looks at PATH_INFO in +env+ to get the current request's path.

 == Return

 No Match:

   {:error => :not_found}

 Match:

   {:ok => {:controller => 'controller', :action => 'action', :var => 'value'}}

 @param env [Hash]
 @return [Hash]