Method: GLI::Commands::CompoundCommand#initialize

Defined in:
lib/gli/commands/compound_command.rb

#initialize(base, configuration, options = {}) ⇒ CompoundCommand

base

object that respondes to commands

configuration

Array of arrays: index 0 is the array of names of this command and index 1 is the names of the compound commands.



8
9
10
11
12
13
14
15
16
17
# File 'lib/gli/commands/compound_command.rb', line 8

def initialize(base,configuration,options={})
  name = configuration.keys.first
  super(options.merge(:names => [name]))

  command_names = configuration[name]

  check_for_unknown_commands!(base,command_names)

  @wrapped_commands = command_names.map { |name| self.class.find_command(base,name) }
end