Class: TTT::Player

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

Direct Known Subclasses

AI, Human

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Player

Returns a new instance of Player.



4
5
6
# File 'lib/ttt/player.rb', line 4

def initialize(options)
  self.side = options.fetch(:side)
end

Instance Attribute Details

#sideObject

Returns the value of attribute side.



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

def side
  @side
end

Instance Method Details

#==(other_player) ⇒ Object



10
11
12
13
# File 'lib/ttt/player.rb', line 10

def ==(other_player)
  self.class == other_player.class &&
    side == other_player.side
end

#moveObject



8
# File 'lib/ttt/player.rb', line 8

def move; end