Class: JbcdenTtt::Board
- Inherits:
-
Object
- Object
- JbcdenTtt::Board
- Extended by:
- Forwardable
- Defined in:
- lib/jbcden_ttt/board.rb
Instance Attribute Summary collapse
-
#board ⇒ Object
Returns the value of attribute board.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(width, height) ⇒ Board
constructor
A new instance of Board.
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
#board ⇒ Object
Returns the value of attribute board.
7 8 9 |
# File 'lib/jbcden_ttt/board.rb', line 7 def board @board end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
7 8 9 |
# File 'lib/jbcden_ttt/board.rb', line 7 def height @height end |
#width ⇒ Object (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
#display ⇒ Object
18 19 20 |
# File 'lib/jbcden_ttt/board.rb', line 18 def display DisplayBoard.call(board) end |