Class: TicTacToe::Board::Row

Inherits:
Object
  • Object
show all
Includes:
SquaresContainer
Defined in:
lib/game_tictactoe_alu4078/tictactoe.rb

Instance Method Summary collapse

Methods included from SquaresContainer

#[], #blanks, #os, #xs

Constructor Details

#initialize(squares, names) ⇒ Row

Returns a new instance of Row.



16
17
18
19
# File 'lib/game_tictactoe_alu4078/tictactoe.rb', line 16

def initialize( squares, names )
  @squares  = squares
  @names    = names
end

Instance Method Details

#to_board_name(index) ⇒ Object



23
24
25
# File 'lib/game_tictactoe_alu4078/tictactoe.rb', line 23

def to_board_name( index ) 
  Board.index_to_name(@names[index]) 
end