Class: RockPaperScissors::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/rock_paper_scissors/player.rb

Direct Known Subclasses

Computer, Human

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board, player_number = 1) ⇒ Player

Returns a new instance of Player.



5
6
7
8
# File 'lib/rock_paper_scissors/player.rb', line 5

def initialize(board, player_number = 1)
  @board = board
  @player_number = player_number
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/rock_paper_scissors/player.rb', line 3

def name
  @name
end