class method
self.command_name
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
self.command_name()
Return command name without namespaces.
Rails::Command::TestCommand.command_name # => 'test'
Source
# File railties/lib/rails/command/base.rb, line 113
def command_name
@command_name ||= if command = name.to_s.split("::").last
command.chomp!("Command")
command.underscore
end
end
Defined in railties/lib/rails/command/base.rb line 113
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Command::Base