Class: ActionDispatch::Routing::RouteWrapper

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
actionpack/lib/action_dispatch/routing/inspector.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#actionObject


48
49
50
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 48

def action
  parts.include?(:action) ? ":action" : requirements[:action]
end

#constraintsObject


20
21
22
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 20

def constraints
  requirements.except(:controller, :action)
end

#controllerObject


44
45
46
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 44

def controller
  parts.include?(:controller) ? ":controller" : requirements[:controller]
end

#endpointObject


9
10
11
12
13
14
15
16
17
18
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 9

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

Returns:

  • (Boolean)

56
57
58
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 56

def engine?
  app.engine?
end

#internal?Boolean

Returns:

  • (Boolean)

52
53
54
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 52

def internal?
  internal
end

#nameObject


32
33
34
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 32

def name
  super.to_s
end

#pathObject


28
29
30
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 28

def path
  super.spec.to_s
end

#rack_appObject


24
25
26
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 24

def rack_app
  app.rack_app
end

#reqsObject


36
37
38
39
40
41
42
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 36

def reqs
  @reqs ||= begin
    reqs = endpoint
    reqs += " #{constraints}" unless constraints.empty?
    reqs
  end
end