Class: Xudoku::Choice

Inherits:
Array
  • Object
show all
Defined in:
lib/xudoku/choice.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from(arr) ⇒ Object



6
7
8
# File 'lib/xudoku/choice.rb', line 6

def self.from(arr)
  new(arr)
end

Instance Method Details

#boardObject



18
19
20
# File 'lib/xudoku/choice.rb', line 18

def board
  self[2]
end

#current_guessObject



26
27
28
# File 'lib/xudoku/choice.rb', line 26

def current_guess
  guesses[current_index]
end

#current_indexObject



14
15
16
# File 'lib/xudoku/choice.rb', line 14

def current_index
  self[1]
end

#exhausted?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/xudoku/choice.rb', line 22

def exhausted?
  current_index >= guesses.size
end

#guessesObject



10
11
12
# File 'lib/xudoku/choice.rb', line 10

def guesses
  self[0]
end

#stepObject



30
31
32
33
# File 'lib/xudoku/choice.rb', line 30

def step
  self[1] += 1
  self
end