class ActionDispatch::Routing::RouteSet::Dispatcher

def controller(req)

def controller(req)
  req.controller_class
rescue NameError => e
  raise ActionController::RoutingError, e.message, e.backtrace
end

def dispatch(controller, action, req, res)

def dispatch(controller, action, req, res)
  controller.dispatch(action, req, res)
end

def dispatcher?; true; end

def dispatcher?; true; end

def initialize(raise_on_name_error)

def initialize(raise_on_name_error)
  @raise_on_name_error = raise_on_name_error
end

def serve(req)

def serve(req)
  params     = req.path_parameters
  controller = controller req
  res        = controller.make_response! req
  dispatch(controller, params[:action], req, res)
rescue ActionController::RoutingError
  if @raise_on_name_error
    raise
  else
    [404, { Constants::X_CASCADE => "pass" }, []]
  end
end