class method
self.command_name
Ruby on Rails 5.2.8.1
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 99
def command_name
@command_name ||= begin
if command = name.to_s.split("::").last
command.chomp!("Command")
command.underscore
end
end
end
Defined in railties/lib/rails/command/base.rb line 99
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Command::Base