Class: Jura::Control::Sprint
Instance Method Summary
collapse
Methods inherited from RootControl
#commands, #set_command, #support_command?
Instance Method Details
#config_commands ⇒ Object
#execute_command(name, opts = nil) ⇒ Object
8
9
10
11
|
# File 'lib/jura/control/sprint.rb', line 8
def execute_command(name, opts = nil)
commands[name].execute!(opts)
executed_commands << [commands[name], opts]
end
|
#executed_commands ⇒ Object
29
30
31
|
# File 'lib/jura/control/sprint.rb', line 29
def executed_commands
@executed_commands ||= []
end
|
#undo_command ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/jura/control/sprint.rb', line 13
def undo_command
return if executed_commands.length < 2
executed_commands.pop
command, opts = executed_commands.pop
command.execute!(opts)
executed_commands << [command, opts]
end
|