class ILoveSudoku::CellMatrixCreator
Attributes
cell_matrix[R]
Public Class Methods
new(matrix)
click to toggle source
# File lib/cell_matrix_creator.rb, line 6 def initialize(matrix) @cell_matrix = create_cell_matrix(matrix) end
Private Instance Methods
create_cell_matrix(matrix)
click to toggle source
# File lib/cell_matrix_creator.rb, line 12 def create_cell_matrix(matrix) matrix.each_with_object([]) do |row, arr| arr << create_row_of_new_cells(row) end end
create_row_of_new_cells(row)
click to toggle source
# File lib/cell_matrix_creator.rb, line 18 def create_row_of_new_cells(row) row.each_with_object([]) do |value, arr| arr << Cell.new(value) end end