Class: ActionDispatch::Routing::RouteWrapper
- Defined in:
- actionpack/lib/action_dispatch/routing/inspector.rb
Overview
:nodoc:
Instance Method Summary collapse
- #action ⇒ Object
- #constraints ⇒ Object
- #controller ⇒ Object
- #endpoint ⇒ Object
- #engine? ⇒ Boolean
- #internal? ⇒ Boolean
- #matches_filter?(filter, value) ⇒ Boolean
- #name ⇒ Object
- #path ⇒ Object
- #rack_app ⇒ Object
- #reqs ⇒ Object
Instance Method Details
#action ⇒ Object
54 55 56 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 54 def action parts.include?(:action) ? ":action" : requirements[:action] end |
#constraints ⇒ Object
26 27 28 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 26 def constraints requirements.except(:controller, :action) end |
#controller ⇒ Object
50 51 52 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 50 def controller parts.include?(:controller) ? ":controller" : requirements[:controller] end |
#endpoint ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 15 def endpoint case when app.dispatcher? "#{controller}##{action}" when rack_app.is_a?(Proc) "Inline handler (Proc/Lambda)" else rack_app.inspect end end |
#engine? ⇒ Boolean
62 63 64 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 62 def engine? app.engine? end |
#internal? ⇒ Boolean
58 59 60 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 58 def internal? internal end |
#matches_filter?(filter, value) ⇒ Boolean
9 10 11 12 13 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 9 def matches_filter?(filter, value) return __getobj__.path.match(value) if filter == :exact_path_match value.match?(public_send(filter)) end |
#name ⇒ Object
38 39 40 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 38 def name super.to_s end |
#path ⇒ Object
34 35 36 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 34 def path super.spec.to_s end |
#rack_app ⇒ Object
30 31 32 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 30 def rack_app app.rack_app end |
#reqs ⇒ Object
42 43 44 45 46 47 48 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 42 def reqs @reqs ||= begin reqs = endpoint reqs += " #{constraints}" unless constraints.empty? reqs end end |