class PaitinHangman::Paitin
Public Instance Methods
choice_integrity(choice)
click to toggle source
# File lib/paitin_hangman.rb, line 21 def choice_integrity(choice) case choice when "p", "play" then new_game when "i", "instruction" then instruction when "q", "quit" then exit when "l", "load" then GameResumption.new else try_again end end
game_control()
click to toggle source
# File lib/paitin_hangman.rb, line 11 def game_control Message.welcome process end
instruction()
click to toggle source
# File lib/paitin_hangman.rb, line 37 def instruction Message.instruction process end
new_game()
click to toggle source
# File lib/paitin_hangman.rb, line 42 def new_game Message.game_intro name = verify_name_integrity puts "Hi #{name}, Select a mode" play(name) end
play(name)
click to toggle source
process()
click to toggle source
# File lib/paitin_hangman.rb, line 16 def process choice = gets.chomp.downcase choice_integrity(choice) end
try_again()
click to toggle source
# File lib/paitin_hangman.rb, line 32 def try_again Message.valid_option process end