public Method

RouteSet.write_recognize_optimized

There's no documentation for this item.

Source Code

# File action_controller/routing/recognition_optimisation.rb, line 76
def write_recognize_optimized
  tree = segment_tree(routes)
  body = generate_code(tree)
  instance_eval %{
    def recognize_optimized(path, env)
      segments = to_plain_segments(path)
      index = #{body}
      return nil unless index
      while index < routes.size
        result = routes[index].recognize(path, env) and return result
        index += 1
      end
      nil
    end
  }, __FILE__, __LINE__
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.