Class: Tictactoe::Player
- Inherits:
-
Object
- Object
- Tictactoe::Player
- Defined in:
- lib/tictactoe/player.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
Instance Method Summary collapse
- #finish(final_board) ⇒ Object
-
#initialize(mark) ⇒ Player
constructor
A new instance of Player.
- #move(board) ⇒ Object
Constructor Details
#initialize(mark) ⇒ Player
Returns a new instance of Player.
5 6 7 |
# File 'lib/tictactoe/player.rb', line 5 def initialize( mark ) @mark = mark # "X" or "O" or " " end |
Instance Attribute Details
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
9 10 11 |
# File 'lib/tictactoe/player.rb', line 9 def mark @mark end |
Instance Method Details
#finish(final_board) ⇒ Object
15 16 |
# File 'lib/tictactoe/player.rb', line 15 def finish( final_board ) end |
#move(board) ⇒ Object
11 12 13 |
# File 'lib/tictactoe/player.rb', line 11 def move( board ) raise NotImplementedError, "Player subclasses must define move()." end |