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
- #commands ⇒ Object
- #initialize ⇒ Object
- #parse_command_options(name) ⇒ Object
- #run_command(name, options = {}) ⇒ Object
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
#commands ⇒ Object
31 32 33 |
# File 'lib/fum/command_manager.rb', line 31 def commands @commands end |
#initialize ⇒ Object
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 (name) @commands[name]. end |
#run_command(name, options = {}) ⇒ Object
39 40 41 |
# File 'lib/fum/command_manager.rb', line 39 def run_command(name, = {}) @commands[name].execute() end |