Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/software_challenge_client/player.rb
Overview
Ein Spieler
Instance Attribute Summary collapse
-
#color ⇒ PlayerColor
readonly
Die Farbe des Spielers, Rot oder Blau.
-
#name ⇒ String
readonly
Der Name des Spielers, hat keine Auswirkungen auf das Spiel.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(color, name) ⇒ Player
constructor
Konstruktor.
Constructor Details
#initialize(color, name) ⇒ Player
Konstruktor
16 17 18 19 |
# File 'lib/software_challenge_client/player.rb', line 16 def initialize(color, name) @color = color @name = name end |
Instance Attribute Details
#color ⇒ PlayerColor (readonly)
Returns die Farbe des Spielers, Rot oder Blau.
11 12 13 |
# File 'lib/software_challenge_client/player.rb', line 11 def color @color end |
#name ⇒ String (readonly)
Returns der Name des Spielers, hat keine Auswirkungen auf das Spiel.
7 8 9 |
# File 'lib/software_challenge_client/player.rb', line 7 def name @name end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/software_challenge_client/player.rb', line 21 def ==(other) color == other.color end |