Class: HumanPlayer
- Inherits:
-
Object
- Object
- HumanPlayer
- Defined in:
- lib/human_player_cli.rb
Instance Attribute Summary collapse
-
#marker ⇒ Object
readonly
Returns the value of attribute marker.
Instance Method Summary collapse
- #choose_space(board) ⇒ Object
-
#initialize(marker, ui) ⇒ HumanPlayer
constructor
A new instance of HumanPlayer.
Constructor Details
#initialize(marker, ui) ⇒ HumanPlayer
Returns a new instance of HumanPlayer.
5 6 7 8 |
# File 'lib/human_player_cli.rb', line 5 def initialize(marker, ui) @marker = marker @ui = ui end |
Instance Attribute Details
#marker ⇒ Object (readonly)
Returns the value of attribute marker.
3 4 5 |
# File 'lib/human_player_cli.rb', line 3 def marker @marker end |
Instance Method Details
#choose_space(board) ⇒ Object
10 11 12 |
# File 'lib/human_player_cli.rb', line 10 def choose_space(board) @ui.place_marker(board.check_available_spaces) end |