Class: RubyTictactoe::UI
- Inherits:
-
Object
- Object
- RubyTictactoe::UI
- Defined in:
- lib/ui.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
Returns the value of attribute io.
Instance Method Summary collapse
- #first_move_message(marker) ⇒ Object
-
#initialize ⇒ UI
constructor
A new instance of UI.
- #next_move_message(marker) ⇒ Object
- #tie_game_message ⇒ Object
- #winning_game_message(marker) ⇒ Object
Constructor Details
#initialize ⇒ UI
Returns a new instance of UI.
5 6 7 |
# File 'lib/ui.rb', line 5 def initialize @io = Kernel end |
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io.
4 5 6 |
# File 'lib/ui.rb', line 4 def io @io end |
Instance Method Details
#first_move_message(marker) ⇒ Object
9 10 11 |
# File 'lib/ui.rb', line 9 def (marker) "Player '#{marker}' goes first." end |
#next_move_message(marker) ⇒ Object
13 14 15 |
# File 'lib/ui.rb', line 13 def (marker) "Player '#{marker}': Make your move." end |
#tie_game_message ⇒ Object
21 22 23 |
# File 'lib/ui.rb', line 21 def "GAME OVER! It's a tie!" end |
#winning_game_message(marker) ⇒ Object
17 18 19 |
# File 'lib/ui.rb', line 17 def (marker) "GAME OVER! Player '#{marker}' wins!" end |