Class: ActionDispatch::Routing::RoutesInspector

Inherits:
Object
  • Object
show all
Defined in:
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:



82
83
84
85
# File 'lib/action_dispatch/routing/inspector.rb', line 82

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

Instance Method Details

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



87
88
89
90
91
92
93
94
95
# File 'lib/action_dispatch/routing/inspector.rb', line 87

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