Class: Nonograms::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/nonograms/checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(vertical, horizontal) ⇒ Checker

Returns a new instance of Checker.



6
7
8
9
# File 'lib/nonograms/checker.rb', line 6

def initialize(vertical, horizontal)
  @vertical = vertical
  @horizontal = horizontal
end

Instance Method Details

#properly_data_entered?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/nonograms/checker.rb', line 11

def properly_data_entered?
  @vertical.flatten.inject(&:+) == @horizontal.flatten.inject(&:+)
end