class ActionDispatch::Routing::ConsoleFormatter::Expanded
Public Class Methods
Source
# File lib/action_dispatch/routing/inspector.rb, line 203 def initialize(width: IO.console_size[1]) @width = width super() end
Calls superclass method
ActionDispatch::Routing::ConsoleFormatter::Base::new
Public Instance Methods
Source
# File lib/action_dispatch/routing/inspector.rb, line 212 def section(routes) @buffer << draw_expanded_section(routes) end
Source
# File lib/action_dispatch/routing/inspector.rb, line 208 def section_title(title) @buffer << "\n#{"[ #{title} ]"}" end
Private Instance Methods
Source
# File lib/action_dispatch/routing/inspector.rb, line 217 def draw_expanded_section(routes) routes.map.each_with_index do |r, i| <<~MESSAGE.chomp #{route_header(index: i + 1)} Prefix | #{r[:name]} Verb | #{r[:verb]} URI | #{r[:path]} Controller#Action | #{r[:reqs]} MESSAGE end end
Source
# File lib/action_dispatch/routing/inspector.rb, line 229 def route_header(index:) "--[ Route #{index} ]".ljust(@width, "-") end