class method
self.namespace
Ruby on Rails 3.0.20
Since v3.0.20Signature
self.namespace(name=nil)
Convenience method to get the namespace from the class name. It’s the same as Thor default except that the Generator at the end of the class is removed.
Parameters
-
nameopt = nil
Source
# File railties/lib/rails/generators/base.rb, line 45
def self.namespace(name=nil)
return super if name
@namespace ||= super.sub(/_generator$/, '').sub(/:generators:/, ':')
end
Defined in railties/lib/rails/generators/base.rb line 45
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Base