class ActionDispatch::Routing::RouteSet::Dispatcher

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/action_dispatch/routing/route_set.rbs

class ActionDispatch::Routing::RouteSet::Dispatcher < ActionDispatch::Routing::RouteSet::Routing::Endpoint
  def dispatch: (Class controller, String action, ActionDispatch::Request req, ActionDispatch::Response res) -> Array[Integer]
end

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)

Experimental RBS support (using type sampling data from the type_fusion project).

def dispatch: (Class controller, String action, ActionDispatch::Request req, ActionDispatch::Response res) -> Hash | x-frame-options | String | x-xss-protection | String | x-content-type-options | String | x-permitted-cross-domain-policies | String | referrer-policy | String | link | String | content-type | String | vary | String | ActionDispatch::Response::RackBody

This signature was generated using 1 sample from 1 application.

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