Class: ActionDispatch::Routing::RouteSet::Dispatcher
- Inherits:
-
Endpoint
- Object
- Endpoint
- ActionDispatch::Routing::RouteSet::Dispatcher
show all
- Defined in:
- lib/action_dispatch/routing/route_set.rb
Instance Method Summary
collapse
Methods inherited from Endpoint
#app, #matches?, #redirect?
Constructor Details
#initialize(raise_on_name_error) ⇒ Dispatcher
Returns a new instance of Dispatcher.
21
22
23
|
# File 'lib/action_dispatch/routing/route_set.rb', line 21
def initialize(raise_on_name_error)
@raise_on_name_error = raise_on_name_error
end
|
Instance Method Details
#dispatcher? ⇒ Boolean
25
|
# File 'lib/action_dispatch/routing/route_set.rb', line 25
def dispatcher?; true; end
|
#serve(req) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/action_dispatch/routing/route_set.rb', line 27
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
return [404, { "X-Cascade" => "pass" }, []]
end
end
|