Module: ConsoleHelper

Defined in:
lib/joe_utils/helpers/console_helper.rb

Instance Method Summary collapse

Instance Method Details

#exit_programObject



13
14
15
# File 'lib/joe_utils/helpers/console_helper.rb', line 13

def exit_program
  exit
end

#get_input(message) ⇒ Object



2
3
4
5
6
# File 'lib/joe_utils/helpers/console_helper.rb', line 2

def get_input(message)
  puts message
  value = gets
  value == 'exit' ? exit_program : next_step(value)
end

#process_input(input, options = {}) ⇒ Object



8
9
10
11
# File 'lib/joe_utils/helpers/console_helper.rb', line 8

def process_input(input, options = {})
  input.each { |arg| yield arg }
  options
end