Method: Rails::Generators::Base.namespace
- Defined in:
- railties/lib/rails/generators/base.rb
.namespace(name = nil) ⇒ Object
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.
54 55 56 57 |
# File 'railties/lib/rails/generators/base.rb', line 54 def self.namespace(name = nil) return super if name @namespace ||= super.delete_suffix("_generator").sub(/:generators:/, ":") end |