Class: Praxis::Router::RequestRouter
- Inherits:
-
Mustermann::Router::Simple
- Object
- Mustermann::Router::Simple
- Praxis::Router::RequestRouter
- Defined in:
- lib/praxis/router.rb
Instance Attribute Summary
Attributes inherited from Mustermann::Router::Simple
Instance Method Summary collapse
-
#initialize(**options, &block) ⇒ RequestRouter
constructor
A new instance of RequestRouter.
- #invoke(callback, request, params, _pattern) ⇒ Object
- #string_for(request) ⇒ Object
Methods inherited from Mustermann::Router::Simple
Constructor Details
#initialize(**options, &block) ⇒ RequestRouter
Returns a new instance of RequestRouter.
27 28 29 30 31 |
# File 'lib/praxis/router.rb', line 27 def initialize(**, &block) [:default] = :not_found super(**, &block) end |
Instance Method Details
#invoke(callback, request, params, _pattern) ⇒ Object
33 34 35 36 |
# File 'lib/praxis/router.rb', line 33 def invoke(callback, request, params, _pattern) request.route_params = params callback.call(request) end |
#string_for(request) ⇒ Object
38 39 40 |
# File 'lib/praxis/router.rb', line 38 def string_for(request) request.path end |