Class: Computer

Inherits:
Player show all
Defined in:
lib/rock_paper_scissors_cli/player.rb

Constant Summary

Constants inherited from Player

Player::WEAPONS

Instance Attribute Summary

Attributes inherited from Player

#item, #name, #total_losses, #total_ties, #total_wins

Instance Method Summary collapse

Methods inherited from Player

#add_loss, #add_tie, #add_win, #render_selection, #render_stats

Constructor Details

#initializeComputer

Returns a new instance of Computer.



49
50
51
# File 'lib/rock_paper_scissors_cli/player.rb', line 49

def initialize()
	super("Computer")
end

Instance Method Details

#select_weaponObject



53
54
55
# File 'lib/rock_paper_scissors_cli/player.rb', line 53

def select_weapon
	@item = WEAPONS.shuffle.first
end