class method
self.instance
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
self.instance(command, generator)
Here’s a convenient way to get a handle on generator commands. Command.instance(‘destroy’, my_generator) instantiates a Destroy delegate of my_generator ready to do your dirty work.
Parameters
-
commandreq -
generatorreq
Source
# File railties/lib/rails_generator/commands.rb, line 13
def self.instance(command, generator)
const_get(command.to_s.camelize).new(generator)
end
Defined in railties/lib/rails_generator/commands.rb line 13
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generator::Commands