Class: Player
Overview
Класс Player (abstract class)
Direct Known Subclasses
Constant Summary
Constants included from Emoji
Emoji::DASH, Emoji::O, Emoji::X
Instance Attribute Summary collapse
-
#board ⇒ Object
Returns the value of attribute board.
-
#enemy ⇒ Object
Returns the value of attribute enemy.
-
#name ⇒ Object
Returns the value of attribute name.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(params) ⇒ Player
constructor
A new instance of Player.
- #make_move(board) ⇒ Object
- #position ⇒ Object
Constructor Details
#initialize(params) ⇒ Player
Returns a new instance of Player.
9 10 11 12 |
# File 'lib/ttt-cli/player.rb', line 9 def initialize(params) @name = params[:name] @token = params[:token] end |
Instance Attribute Details
#board ⇒ Object
Returns the value of attribute board.
5 6 7 |
# File 'lib/ttt-cli/player.rb', line 5 def board @board end |
#enemy ⇒ Object
Returns the value of attribute enemy.
5 6 7 |
# File 'lib/ttt-cli/player.rb', line 5 def enemy @enemy end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/ttt-cli/player.rb', line 5 def name @name end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/ttt-cli/player.rb', line 5 def token @token end |
Instance Method Details
#make_move(board) ⇒ Object
14 |
# File 'lib/ttt-cli/player.rb', line 14 def make_move(board); end |
#position ⇒ Object
16 |
# File 'lib/ttt-cli/player.rb', line 16 def position; end |