Skip to content

Commit

Permalink
decouple initialize from clear!. Initialize ivars in initialize, clear
Browse files Browse the repository at this point in the history
ivars in clear!
  • Loading branch information
tenderlove committed Dec 29, 2011
1 parent 25b10f4 commit c0904e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -83,18 +83,18 @@ class NamedRouteCollection #:nodoc:
attr_reader :routes, :helpers, :module

def initialize
clear!
@routes = {}
@helpers = []
@module = Module.new
end

def helper_names
self.module.instance_methods.map(&:to_s)
end

def clear!
@routes = {}
@helpers = []

@module ||= Module.new
@routes.clear
@helpers.clear
end

def add(name, route)
Expand Down

0 comments on commit c0904e4

Please sign in to comment.