Class: ActionDispatch::Routing::RoutesInspector

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

Overview

This class is just used for displaying route information when someone executes ‘bin/rails routes` or looks at the RoutingError page. People should not use this class.

Instance Method Summary collapse

Constructor Details

#initialize(routes) ⇒ RoutesInspector

:nodoc:



110
111
112
113
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 110

def initialize(routes)
  @routes = wrap_routes(routes)
  @engines = load_engines_routes
end

Instance Method Details

#format(formatter, filter = {}) ⇒ Object



115
116
117
118
119
120
121
122
123
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 115

def format(formatter, filter = {})
  all_routes = { nil => @routes }.merge(@engines)

  all_routes.each do |engine_name, routes|
    format_routes(formatter, filter, engine_name, routes)
  end

  formatter.result
end