Class: JbcdenTtt::Board

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/jbcden_ttt/board.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height) ⇒ Board

Returns a new instance of Board.



9
10
11
12
13
14
15
16
# File 'lib/jbcden_ttt/board.rb', line 9

def initialize(width, height)
  @width = width
  @height = height
  @board = Array.new(height)

  init_board_array
  init_board
end

Instance Attribute Details

#boardObject

Returns the value of attribute board.



7
8
9
# File 'lib/jbcden_ttt/board.rb', line 7

def board
  @board
end

#heightObject (readonly)

Returns the value of attribute height.



7
8
9
# File 'lib/jbcden_ttt/board.rb', line 7

def height
  @height
end

#widthObject (readonly)

Returns the value of attribute width.



7
8
9
# File 'lib/jbcden_ttt/board.rb', line 7

def width
  @width
end

Instance Method Details

#displayObject



18
19
20
# File 'lib/jbcden_ttt/board.rb', line 18

def display
  DisplayBoard.call(board)
end