class DjmhRockPaperScissors::Human
Public Instance Methods
get_move()
click to toggle source
# File lib/djmh_rock_paper_scissors/human.rb, line 4 def get_move() prompt_user input=gets.chomp.downcase input if valid_move?(input) end
prompt_user()
click to toggle source
# File lib/djmh_rock_paper_scissors/human.rb, line 15 def prompt_user puts "Player #{@player_number}: Rock, paper, or scissors?" end
turn()
click to toggle source
Calls superclass method
# File lib/djmh_rock_paper_scissors/human.rb, line 10 def turn super puts "Player #{@player_number} chose #{@move}." end
Private Instance Methods
valid_move?(move)
click to toggle source
# File lib/djmh_rock_paper_scissors/human.rb, line 20 def valid_move?(move) moves=%w(rock paper scissors) moves.include?(move) end