path is a path constraint. constraints is a hash of
constraints to be applied to this route.
# File actionpack/lib/action_dispatch/journey/route.rb, line 14
def initialize(name, app, path, constraints, defaults = {})
@name = name
@app = app
@path = path
# Unwrap any constraints so we can see what's inside for route generation.
# This allows the formatter to skip over any mounted applications or redirects
# that shouldn't be matched when using a url_for without a route name.
while app.is_a?(Routing::Mapper::Constraints) do
app = app.app
end
@dispatcher = app.is_a?(Routing::RouteSet::Dispatcher)
@constraints = constraints
@defaults = defaults
@required_defaults = nil
@required_parts = nil
@parts = nil
@decorated_ast = nil
@precedence = 0
end