Class: Jura::Control::Sprint

Inherits:
RootControl show all
Defined in:
lib/jura/control/sprint.rb

Instance Method Summary collapse

Methods inherited from RootControl

#commands, #set_command, #support_command?

Instance Method Details

#config_commandsObject



22
23
24
25
26
27
# File 'lib/jura/control/sprint.rb', line 22

def config_commands
  set_command("list", Command::Sprint::List)
  set_command("active", Command::Sprint::Active)
  set_command("display_submenu", Command::Sprint::DisplaySubmenu)
  set_command("show_issue", Command::Sprint::ShowIssue)
end

#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_commandsObject



29
30
31
# File 'lib/jura/control/sprint.rb', line 29

def executed_commands
  @executed_commands ||= []
end

#undo_commandObject



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