Class: Tictactoe::Boards::Square
- Inherits:
-
Object
- Object
- Tictactoe::Boards::Square
- Defined in:
- lib/tictactoe/boards/square.rb
Instance Method Summary collapse
-
#initialize(side_size) ⇒ Square
constructor
A new instance of Square.
- #lines ⇒ Object
- #locations ⇒ Object
Constructor Details
#initialize(side_size) ⇒ Square
Returns a new instance of Square.
4 5 6 |
# File 'lib/tictactoe/boards/square.rb', line 4 def initialize(side_size) self.side_size = side_size end |
Instance Method Details
#lines ⇒ Object
12 13 14 |
# File 'lib/tictactoe/boards/square.rb', line 12 def lines @lines ||= horizontal_lines + vertical_lines + diagonal_lines end |
#locations ⇒ Object
8 9 10 |
# File 'lib/tictactoe/boards/square.rb', line 8 def locations @locations ||= (0..(side_size * side_size) -1).to_a end |