Class: RubyTictactoe::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUI

Returns a new instance of UI.



5
6
7
# File 'lib/ui.rb', line 5

def initialize
  @io = Kernel
end

Instance Attribute Details

#ioObject

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 first_move_message(marker)
  "Player '#{marker}' goes first."
end

#next_move_message(marker) ⇒ Object



13
14
15
# File 'lib/ui.rb', line 13

def next_move_message(marker)
  "Player '#{marker}': Make your move."
end

#tie_game_messageObject



21
22
23
# File 'lib/ui.rb', line 21

def tie_game_message
  "GAME OVER! It's a tie!"
end

#winning_game_message(marker) ⇒ Object



17
18
19
# File 'lib/ui.rb', line 17

def winning_game_message(marker)
  "GAME OVER! Player '#{marker}' wins!"
end