Class: MenuCommander::Command

Inherits:
MisterBin::Command
  • Object
show all
Defined in:
lib/menu_commander/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_commandObject (readonly)

Returns the value of attribute last_command.



21
22
23
# File 'lib/menu_commander/command.rb', line 21

def last_command
  @last_command
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/menu_commander/command.rb', line 23

def run
  verify_sanity
  say "#{menu.options.header}\n" if menu.options.header
  success = true

  if args['--loop']
    run_looped_menu
  else
    success = run_menu
  end

  success ? 0 : 1
end