Class: TicTacToe::HumanPlayer
- Inherits:
-
Object
- Object
- TicTacToe::HumanPlayer
- Defined in:
- lib/human_player.rb
Instance Attribute Summary collapse
-
#player_mark ⇒ Object
readonly
Returns the value of attribute player_mark.
Instance Method Summary collapse
-
#initialize(parameters) ⇒ HumanPlayer
constructor
A new instance of HumanPlayer.
- #move ⇒ Object
Constructor Details
#initialize(parameters) ⇒ HumanPlayer
Returns a new instance of HumanPlayer.
5 6 7 8 |
# File 'lib/human_player.rb', line 5 def initialize(parameters) @player_mark = parameters[:player_mark] @interface = parameters[:interface] end |
Instance Attribute Details
#player_mark ⇒ Object (readonly)
Returns the value of attribute player_mark.
3 4 5 |
# File 'lib/human_player.rb', line 3 def player_mark @player_mark end |
Instance Method Details
#move ⇒ Object
10 11 12 |
# File 'lib/human_player.rb', line 10 def move @interface.solicit_move(@player_mark) end |