Class: CommandManager
- Inherits:
-
Object
- Object
- CommandManager
- Defined in:
- lib/command_manager.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
- #execute(hypotheses) ⇒ Object
-
#initialize(path) ⇒ CommandManager
constructor
A new instance of CommandManager.
Constructor Details
#initialize(path) ⇒ CommandManager
Returns a new instance of CommandManager.
6 7 8 |
# File 'lib/command_manager.rb', line 6 def initialize(path) @commands = YAML.load_file(path) if File.exist?(path) end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
4 5 6 |
# File 'lib/command_manager.rb', line 4 def commands @commands end |
Instance Method Details
#execute(hypotheses) ⇒ Object
10 11 12 13 14 |
# File 'lib/command_manager.rb', line 10 def execute(hypotheses) command = find(hypotheses) system("#{command} &") return command end |