Class: TicTacToe::Human

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mark) ⇒ Human

Returns a new instance of Human.



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

def initialize(mark)
  @mark = mark
end

Instance Attribute Details

#markObject (readonly)

Returns the value of attribute mark.



3
4
5
# File 'lib/ttt/human.rb', line 3

def mark
  @mark
end

Instance Method Details

#make_move(space, board) ⇒ Object



9
10
11
# File 'lib/ttt/human.rb', line 9

def make_move(space, board)
  board.place_move(@mark, space)
end