class Shellout::CommandLoop

Public Class Methods

new(menu) click to toggle source
# File lib/shellout/command_loop.rb, line 5
def initialize(menu)
  @menu = menu
end

Public Instance Methods

call() click to toggle source
# File lib/shellout/command_loop.rb, line 9
def call
  loop do
    begin
      task = @menu.call
      task.call
    rescue Interrupt    # ^C
      puts              # Add a new line in case we are prompting
    end
  end
end