123456789_123456789_123456789_123456789_123456789_

Class: Rails::Command::UnusedRoutesCommand::RouteInfo

Relationships & Source Files
Inherits: Object
Defined in: railties/lib/rails/commands/unused_routes/unused_routes_command.rb

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(route) ⇒ RouteInfo

[ GitHub ]

  
# File 'railties/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 Attribute Details

#unused?Boolean (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/commands/unused_routes/unused_routes_command.rb', line 20

def unused?
  controller_class_missing? || (action_missing? && template_missing?)
end