module Roda::RodaPlugins::MultiRoute::RequestClassMethods

Public Instance Methods

clear_named_route_regexp!() click to toggle source

Clear cached regexp for named routes, it will be regenerated the next time it is needed.

This shouldn’t be an issue in production applications, but during development it’s useful to support new named routes being added while the application is running.

# File lib/roda/plugins/multi_route.rb, line 97
def clear_named_route_regexp!
  @named_route_regexp = nil
end
named_route_regexp() click to toggle source

A regexp matching any of the current named routes.

# File lib/roda/plugins/multi_route.rb, line 102
def named_route_regexp
  @named_route_regexp ||= /(#{Regexp.union(roda_class.named_routes.select{|s| s.is_a?(String)})})/
end