Class: TouchscreenTaps::Executor
- Inherits:
-
Object
- Object
- TouchscreenTaps::Executor
- Defined in:
- lib/touchscreen_taps/executor.rb
Overview
Executes commands from config file
Instance Method Summary collapse
-
#initialize(config) ⇒ Executor
constructor
A new instance of Executor.
- #run(cmd) ⇒ Object
Constructor Details
#initialize(config) ⇒ Executor
Returns a new instance of Executor.
6 7 8 |
# File 'lib/touchscreen_taps/executor.rb', line 6 def initialize(config) @config = config end |
Instance Method Details
#run(cmd) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/touchscreen_taps/executor.rb', line 10 def run(cmd) return if cmd.nil? command = @config.by_keys(command_to_keys(cmd)).fetch('command') execute(command) if command end |