Class: Sudoku::SolutionSet::Constraints::CellMustBeFilled

Inherits:
Object
  • Object
show all
Defined in:
lib/sudoku/solution_set/constraints/cell_must_be_filled.rb

Instance Method Summary collapse

Constructor Details

#initialize(column, row) ⇒ CellMustBeFilled

Returns a new instance of CellMustBeFilled.



5
6
7
# File 'lib/sudoku/solution_set/constraints/cell_must_be_filled.rb', line 5

def initialize(column, row)
  @column, @row = column, row
end

Instance Method Details

#satisfied_by?(choice) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/sudoku/solution_set/constraints/cell_must_be_filled.rb', line 9

def satisfied_by?(choice)
  choice.column == @column && choice.row == @row
end