Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/tic_cat_toe/player.rb
Overview
Player methods
Instance Attribute Summary collapse
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
-
#victories ⇒ Object
readonly
Returns the value of attribute victories.
Instance Method Summary collapse
-
#initialize(simbol) ⇒ Player
constructor
A new instance of Player.
- #wins ⇒ Object
Constructor Details
#initialize(simbol) ⇒ Player
Returns a new instance of Player.
7 8 9 10 |
# File 'lib/tic_cat_toe/player.rb', line 7 def initialize(simbol) @mark = simbol @victories = 0 end |
Instance Attribute Details
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
5 6 7 |
# File 'lib/tic_cat_toe/player.rb', line 5 def mark @mark end |
#victories ⇒ Object (readonly)
Returns the value of attribute victories.
5 6 7 |
# File 'lib/tic_cat_toe/player.rb', line 5 def victories @victories end |
Instance Method Details
#wins ⇒ Object
12 13 14 |
# File 'lib/tic_cat_toe/player.rb', line 12 def wins @victories += 1 end |