Class: Sudoku::SolutionSet::Constraints::CellMustBeFilled
- Inherits:
-
Object
- Object
- Sudoku::SolutionSet::Constraints::CellMustBeFilled
- Defined in:
- lib/sudoku/solution_set/constraints/cell_must_be_filled.rb
Instance Method Summary collapse
-
#initialize(column, row) ⇒ CellMustBeFilled
constructor
A new instance of CellMustBeFilled.
- #satisfied_by?(choice) ⇒ Boolean
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
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 |