class TicTacToe::Squares
Public Instance Methods
all_equal?()
click to toggle source
# File lib/tic_tac_toe_mchliakh/board/squares.rb, line 19 def all_equal? all? {|s| s == first } end
all_taken?()
click to toggle source
# File lib/tic_tac_toe_mchliakh/board/squares.rb, line 15 def all_taken? none?(&:empty?) end
empty()
click to toggle source
# File lib/tic_tac_toe_mchliakh/board/squares.rb, line 3 def empty select(&:empty?) end
taken_by(player)
click to toggle source
# File lib/tic_tac_toe_mchliakh/board/squares.rb, line 7 def taken_by(player) select {|s| s.taken_by?(player) } end
taken_by_opponent(player)
click to toggle source
# File lib/tic_tac_toe_mchliakh/board/squares.rb, line 11 def taken_by_opponent(player) select {|s| s.taken_by_opponent?(player) } end