Class: Rails::Command::UnusedRoutesCommand::RouteInfo
- Inherits:
-
Object
- Object
- Rails::Command::UnusedRoutesCommand::RouteInfo
- Defined in:
- lib/rails/commands/unused_routes/unused_routes_command.rb
Instance Method Summary collapse
-
#initialize(route) ⇒ RouteInfo
constructor
A new instance of RouteInfo.
- #unused? ⇒ Boolean
Constructor Details
#initialize(route) ⇒ RouteInfo
Returns a new instance of RouteInfo.
13 14 15 16 17 18 |
# File 'lib/rails/commands/unused_routes/unused_routes_command.rb', line 13 def initialize(route) requirements = route.requirements @controller_name = requirements[:controller] @action_name = requirements[:action] @controller_class = (@controller_name.to_s.camelize + "Controller").safe_constantize end |
Instance Method Details
#unused? ⇒ Boolean
20 21 22 |
# File 'lib/rails/commands/unused_routes/unused_routes_command.rb', line 20 def unused? controller_class_missing? || (action_missing? && template_missing?) end |