Class: Tarzan::Interfaces::Shell::Interface

Inherits:
Base::Interface show all
Defined in:
lib/tarzan/interfaces/shell/interface.rb

Instance Method Summary collapse

Methods inherited from Base::Interface

#play

Instance Method Details

#prompt(valid_choices = []) ⇒ Object



12
13
14
15
16
# File 'lib/tarzan/interfaces/shell/interface.rb', line 12

def prompt(valid_choices = [])
  say %{Pick one: #{valid_choices.join ' - '} }
  choice = gets.strip
  valid_choices.include?(choice) ? choice : prompt(valid_choices)
end

#say(message) ⇒ Object



8
9
10
# File 'lib/tarzan/interfaces/shell/interface.rb', line 8

def say(message)
  puts message
end