module Roda::RodaPlugins::MultiRoute::ClassMethods
Public Instance Methods
Source
# File lib/roda/plugins/multi_route.rb, line 95 def freeze super opts[:namespaced_routes].each_key do |k| self::RodaRequest.named_route_regexp(k) end self::RodaRequest.instance_variable_get(:@namespaced_route_regexps).freeze self end
Freeze the multi_route regexp matchers so that there can be no thread safety issues at runtime.
Calls superclass method
Source
# File lib/roda/plugins/multi_route.rb, line 105 def inherited(subclass) super subclass::RodaRequest.instance_variable_set(:@namespaced_route_regexps, {}) end
Copy the named routes into the subclass when inheriting.
Calls superclass method
Source
# File lib/roda/plugins/multi_route.rb, line 111 def route(name=nil, namespace=nil, &block) super if name self::RodaRequest.clear_named_route_regexp!(namespace) end end
Clear the multi_route regexp matcher for the namespace.
Calls superclass method