Module: Fum::CommandManager

Included in:
Application
Defined in:
lib/fum/command_manager.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(includer) ⇒ Object



23
24
25
# File 'lib/fum/command_manager.rb', line 23

def self.included(includer)
  includer.extend ClassMethods
end

Instance Method Details

#commandsObject



31
32
33
# File 'lib/fum/command_manager.rb', line 31

def commands
  @commands
end

#initializeObject



27
28
29
# File 'lib/fum/command_manager.rb', line 27

def initialize
  @commands = self.class.create_commands(self)
end

#parse_command_options(name) ⇒ Object



35
36
37
# File 'lib/fum/command_manager.rb', line 35

def parse_command_options(name)
  @commands[name].parse_options
end

#run_command(name, options = {}) ⇒ Object



39
40
41
# File 'lib/fum/command_manager.rb', line 39

def run_command(name, options = {})
  @commands[name].execute(options)
end