Method: CommandKit::Commands::Subcommand#initialize

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

#initialize(command, summary: self.class.summary(command), aliases: []) ⇒ Subcommand

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.

Initializes the subcommand.

Parameters:

  • command (Class)

    The command class.

  • summary (String, nil) (defaults to: self.class.summary(command))

    A short summary for the subcommand. Defaults to the first sentence of the command.

  • aliases (Array<String>) (defaults to: [])

    Optional alias names for the subcommand.



38
39
40
41
42
43
# File 'lib/command_kit/commands/subcommand.rb', line 38

def initialize(command, summary: self.class.summary(command),
                             aliases: [])
  @command = command
  @summary = summary
  @aliases = aliases.map(&:to_s)
end