Class: Mastermind::Player
- Inherits:
-
Object
- Object
- Mastermind::Player
- Defined in:
- lib/mastermind/player.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#completion_time ⇒ Object
Returns the value of attribute completion_time.
-
#guesses ⇒ Object
Returns the value of attribute guesses.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#round_over ⇒ Object
Returns the value of attribute round_over.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#turn_pos ⇒ Object
Returns the value of attribute turn_pos.
Instance Method Summary collapse
-
#initialize(name) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(name) ⇒ Player
Returns a new instance of Player.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/mastermind/player.rb', line 6 def initialize(name) @secret = ["X", "X", "X", "X"] @name = name @round_over = false @guesses = [] @command = "" @start_time = nil @completion_time = nil @turn_pos = nil end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def command @command end |
#completion_time ⇒ Object
Returns the value of attribute completion_time.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def completion_time @completion_time end |
#guesses ⇒ Object
Returns the value of attribute guesses.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def guesses @guesses end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mastermind/player.rb', line 3 def name @name end |
#round_over ⇒ Object
Returns the value of attribute round_over.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def round_over @round_over end |
#secret ⇒ Object
Returns the value of attribute secret.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def secret @secret end |
#start_time ⇒ Object
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def start_time @start_time end |
#turn_pos ⇒ Object
Returns the value of attribute turn_pos.
4 5 6 |
# File 'lib/mastermind/player.rb', line 4 def turn_pos @turn_pos end |