class method
self.namespace
Ruby on Rails 7.1.6
Since v5.2.8.1Signature
self.namespace(name = nil)
Convenience method to get the namespace from the class name. It’s the same as Thor default except that the Command at the end of the class is removed.
Parameters
-
nameopt = nil
Source
# File railties/lib/rails/command/base.rb, line 45
def namespace(name = nil)
if name
super
else
@namespace ||= super.chomp("_command").sub(/:command:/, ":")
end
end
Defined in railties/lib/rails/command/base.rb line 45
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Command::Base