class method self.instance

Ruby on Rails 2.2.3

Last seen in v2.3.18

Available 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

command req
generator req
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

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close