Class: ActionDispatch::Routing::RouteSet::Dispatcher
- Defined in:
 - lib/action_dispatch/routing/route_set.rb
 
Direct Known Subclasses
Instance Method Summary collapse
- #dispatcher? ⇒ Boolean
 - 
  
    
      #initialize(raise_on_name_error)  ⇒ Dispatcher 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Dispatcher.
 - #serve(req) ⇒ Object
 
Methods inherited from Endpoint
#app, #engine?, #matches?, #rack_app, #redirect?
Constructor Details
#initialize(raise_on_name_error) ⇒ Dispatcher
Returns a new instance of Dispatcher.
      24 25 26  | 
    
      # File 'lib/action_dispatch/routing/route_set.rb', line 24 def initialize(raise_on_name_error) @raise_on_name_error = raise_on_name_error end  | 
  
Instance Method Details
#dispatcher? ⇒ Boolean
      28  | 
    
      # File 'lib/action_dispatch/routing/route_set.rb', line 28 def dispatcher?; true; end  | 
  
#serve(req) ⇒ Object
      30 31 32 33 34 35 36 37 38 39 40 41  | 
    
      # File 'lib/action_dispatch/routing/route_set.rb', line 30 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  |