Method: CommandKit::Commands::AutoRequire#included

Defined in:
lib/command_kit/commands/auto_require.rb

#included(command) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Includes CommandKit::Commands and adds a default proc to .commands.

Parameters:



144
145
146
147
148
149
150
151
# File 'lib/command_kit/commands/auto_require.rb', line 144

def included(command)
  command.include Commands
  command.commands.default_proc = ->(hash,key) {
    hash[key] = if (command_class = command(key))
                  Commands::Subcommand.new(command_class)
                end
  }
end