Class: Sudoku::SolutionSet::Process::Step
- Inherits:
-
Object
- Object
- Sudoku::SolutionSet::Process::Step
show all
- Defined in:
- lib/sudoku/solution_set/process/step.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(solution_set) ⇒ Step
Returns a new instance of Step.
7
8
9
|
# File 'lib/sudoku/solution_set/process/step.rb', line 7
def initialize(solution_set)
@solution_set = solution_set
end
|
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
5
6
7
|
# File 'lib/sudoku/solution_set/process/step.rb', line 5
def output
@output
end
|
Instance Method Details
#constraints ⇒ Object
32
33
34
|
# File 'lib/sudoku/solution_set/process/step.rb', line 32
def constraints
@solution_set.constraints
end
|
#delete_excluded_choices_if(&block) ⇒ Object
56
57
58
|
# File 'lib/sudoku/solution_set/process/step.rb', line 56
def delete_excluded_choices_if(&block)
@solution_set.delete_excluded_choices_if(&block)
end
|
#exclude_choice(choice) ⇒ Object
48
49
50
|
# File 'lib/sudoku/solution_set/process/step.rb', line 48
def exclude_choice(choice)
@solution_set.exclude_choice(choice)
end
|
#excluded_choices ⇒ Object
36
37
38
|
# File 'lib/sudoku/solution_set/process/step.rb', line 36
def excluded_choices
@solution_set.excluded_choices
end
|
#include_choice(choice) ⇒ Object
44
45
46
|
# File 'lib/sudoku/solution_set/process/step.rb', line 44
def include_choice(choice)
@solution_set.include_choice(choice)
end
|
#included_choices ⇒ Object
40
41
42
|
# File 'lib/sudoku/solution_set/process/step.rb', line 40
def included_choices
@solution_set.included_choices
end
|
#restore_excluded_choices(choices) ⇒ Object
52
53
54
|
# File 'lib/sudoku/solution_set/process/step.rb', line 52
def restore_excluded_choices(choices)
@solution_set.restore_excluded_choices(choices)
end
|
#retry? ⇒ Boolean
28
29
30
|
# File 'lib/sudoku/solution_set/process/step.rb', line 28
def retry?
@output
end
|
#revert ⇒ Object
20
21
22
|
# File 'lib/sudoku/solution_set/process/step.rb', line 20
def revert
revert!
end
|
#revert! ⇒ Object
24
25
26
|
# File 'lib/sudoku/solution_set/process/step.rb', line 24
def revert!
raise NotImplementedError, "#{self.class}#revert! not implemented"
end
|
#take(input = nil) ⇒ Object
11
12
13
14
|
# File 'lib/sudoku/solution_set/process/step.rb', line 11
def take(input=nil)
@input ||= input
@output = take!(*[@input].compact)
end
|
#take!(*args) ⇒ Object
16
17
18
|
# File 'lib/sudoku/solution_set/process/step.rb', line 16
def take!(*args)
raise NotImplementedError, "#{self.class}#take! not implemented"
end
|