提交 c0904e47 编写于 作者: A Aaron Patterson

decouple initialize from clear!. Initialize ivars in initialize, clear

ivars in clear!
上级 25b10f4c
......@@ -83,7 +83,9 @@ class NamedRouteCollection #:nodoc:
attr_reader :routes, :helpers, :module
def initialize
clear!
@routes = {}
@helpers = []
@module = Module.new
end
def helper_names
......@@ -91,10 +93,8 @@ def helper_names
end
def clear!
@routes = {}
@helpers = []
@module ||= Module.new
@routes.clear
@helpers.clear
end
def add(name, route)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册