Class: Tuttle::Presenters::ActionDispatch::Routing::RouteWrapper
- Inherits:
-
ActionDispatch::Routing::RouteWrapper
- Object
- ActionDispatch::Routing::RouteWrapper
- Tuttle::Presenters::ActionDispatch::Routing::RouteWrapper
- Defined in:
- lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb
Instance Method Summary collapse
- #action ⇒ Object
- #controller ⇒ Object
- #endpoint_or_app_name ⇒ Object
- #route_problem ⇒ Object
- #uses_dispatcher? ⇒ Boolean
Instance Method Details
#action ⇒ Object
20 21 22 |
# File 'lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb', line 20 def action super if uses_dispatcher? end |
#controller ⇒ Object
16 17 18 |
# File 'lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb', line 16 def controller super if uses_dispatcher? end |
#endpoint_or_app_name ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb', line 8 def endpoint_or_app_name if uses_dispatcher? endpoint else rack_app.is_a?(Class) ? rack_app : rack_app.class end end |
#route_problem ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb', line 28 def route_problem # TODO: this does not handle ImplicitRender actions where the method does not exist but the template does return @route_problem if defined?(@route_problem) @route_problem = if controller_klass if requirements[:action] && controller_klass.action_methods.exclude?(action) 'Action does not exist' end elsif requirements[:controller] 'Controller does not exist' end end |
#uses_dispatcher? ⇒ Boolean
24 25 26 |
# File 'lib/tuttle/presenters/action_dispatch/routing/route_wrapper.rb', line 24 def uses_dispatcher? rack_app.respond_to?(:dispatcher?) end |