Class: MCLI::CommandGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/mcli/command_group.rb

Class Method Summary collapse

Class Method Details

.clearObject



15
16
17
# File 'lib/mcli/command_group.rb', line 15

def clear
  @commands = {}
end

.commandsObject



11
12
13
# File 'lib/mcli/command_group.rb', line 11

def commands
  @commands ||= {}
end

.register(command_name, command_klass) ⇒ Object



3
4
5
# File 'lib/mcli/command_group.rb', line 3

def register(command_name, command_klass)
  commands[command_name] = command_klass
end

.register_root(command_klass) ⇒ Object



7
8
9
# File 'lib/mcli/command_group.rb', line 7

def register_root(command_klass)
  @root_command = command_klass
end

.root_commandObject



19
20
21
# File 'lib/mcli/command_group.rb', line 19

def root_command
  @root_command
end