Class: Connect::Player
- Inherits:
-
Object
- Object
- Connect::Player
- Defined in:
- lib/connect/player.rb
Instance Attribute Summary collapse
-
#piece ⇒ Object
readonly
Returns the value of attribute piece.
Instance Method Summary collapse
-
#initialize ⇒ Player
constructor
A new instance of Player.
- #make_move(column, board) ⇒ Object
Constructor Details
#initialize ⇒ Player
Returns a new instance of Player.
7 8 9 |
# File 'lib/connect/player.rb', line 7 def initialize @piece = 'X' end |
Instance Attribute Details
#piece ⇒ Object (readonly)
Returns the value of attribute piece.
5 6 7 |
# File 'lib/connect/player.rb', line 5 def piece @piece end |
Instance Method Details
#make_move(column, board) ⇒ Object
11 12 13 |
# File 'lib/connect/player.rb', line 11 def make_move(column, board) board.add_piece(column, @piece) end |