Class: ActionDispatch::Routing::RouteWrapper
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ActionDispatch::Routing::RouteWrapper
- Defined in:
- lib/action_dispatch/routing/inspector.rb
Instance Method Summary collapse
- #action ⇒ Object
- #constraints ⇒ Object
- #controller ⇒ Object
- #endpoint ⇒ Object
- #engine? ⇒ Boolean
- #internal? ⇒ Boolean
- #name ⇒ Object
- #path ⇒ Object
- #rack_app ⇒ Object
- #reqs ⇒ Object
Instance Method Details
#action ⇒ Object
41 42 43 |
# File 'lib/action_dispatch/routing/inspector.rb', line 41 def action parts.include?(:action) ? ":action" : requirements[:action] end |
#constraints ⇒ Object
13 14 15 |
# File 'lib/action_dispatch/routing/inspector.rb', line 13 def constraints requirements.except(:controller, :action) end |
#controller ⇒ Object
37 38 39 |
# File 'lib/action_dispatch/routing/inspector.rb', line 37 def controller parts.include?(:controller) ? ":controller" : requirements[:controller] end |
#endpoint ⇒ Object
9 10 11 |
# File 'lib/action_dispatch/routing/inspector.rb', line 9 def endpoint app.dispatcher? ? "#{controller}##{action}" : rack_app.inspect end |
#engine? ⇒ Boolean
49 50 51 |
# File 'lib/action_dispatch/routing/inspector.rb', line 49 def engine? app.engine? end |
#internal? ⇒ Boolean
45 46 47 |
# File 'lib/action_dispatch/routing/inspector.rb', line 45 def internal? internal end |
#name ⇒ Object
25 26 27 |
# File 'lib/action_dispatch/routing/inspector.rb', line 25 def name super.to_s end |
#path ⇒ Object
21 22 23 |
# File 'lib/action_dispatch/routing/inspector.rb', line 21 def path super.spec.to_s end |
#rack_app ⇒ Object
17 18 19 |
# File 'lib/action_dispatch/routing/inspector.rb', line 17 def rack_app app.rack_app end |
#reqs ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/action_dispatch/routing/inspector.rb', line 29 def reqs @reqs ||= begin reqs = endpoint reqs += " #{constraints}" unless constraints.empty? reqs end end |