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 controller: (ActionDispatch::Request req) -> Class def dispatch: (Class controller, String action, ActionDispatch::Request req, ActionDispatch::Response res) -> Array[Integer] def dispatcher?: () -> true def initialize: (true raise_on_name_error) -> void def serve: (ActionDispatch::Request req) -> nil end
def controller(req)
Experimental RBS support (using type sampling data from the type_fusion
project).
def controller: (ActionDispatch::Request req) -> Class
This signature was generated using 1 sample from 1 application.
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-Download-Options | String | X-Permitted-Cross-Domain-Policies | String | Referrer-Policy | String | Content-Type | String | Vary | String | ActionDispatch::Response::RackBody
This signature was generated using 4 samples from 1 application.
def dispatch(controller, action, req, res) controller.dispatch(action, req, res) end
def dispatcher?; true; end
Experimental RBS support (using type sampling data from the type_fusion
project).
def dispatcher?: () -> true
This signature was generated using 5 samples from 1 application.
def dispatcher?; true; end
def initialize(raise_on_name_error)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (true raise_on_name_error) -> void
This signature was generated using 2 samples from 1 application.
def initialize(raise_on_name_error) @raise_on_name_error = raise_on_name_error end
def serve(req)
Experimental RBS support (using type sampling data from the type_fusion
project).
def serve: (ActionDispatch::Request req) -> nil
This signature was generated using 1 sample from 1 application.
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, { "X-Cascade" => "pass" }, []] end end