Class: Dispatcher
- Inherits:
-
Object
- Object
- Dispatcher
- Includes:
- ActionDispatch::Routing::UrlFor
- Defined in:
- app/rack/dispatcher.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'app/rack/dispatcher.rb', line 5 def env @env end |
Class Method Details
.call(env) ⇒ Object
22 23 24 |
# File 'app/rack/dispatcher.rb', line 22 def self.call(env) new(env).dispatch end |
Instance Method Details
#dispatch ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/rack/dispatcher.rb', line 7 def dispatch # find permalink, raising error if none found if permalink # mutate env to include params for delegate route params.merge! content_route # setup and delegate to the matched route delegate.action(content_route[:action]).call(env) else # no slug matched, abstain from handling request [404, {"X-Cascade" => "pass"}, ["no such slug exists"]] end end |