lib/validates_modulus/mod11.rb
# Calclulates the checksum according to the modulus 11 algorithm.
Calclulates the checksum according to the modulus 11 algorithm.
Calclulates the checksum according to the modulus 11 algorithm .
def checksum
        @value.reverse.chars.drop(1).map.with_index do |number, index|
          number.to_i * WEIGHT[index % 6]
        end.inject(:+)
      end
def checksum @value . reverse . chars . drop ( 1 ) . map . with_index do | number , index | number . to_i * WEIGHT [ index % 6 ] end . inject ( :+ ) end
Calclulates the checksum according to the modulus 11 algorithm.
Calclulates the checksum according to the modulus 11 algorithm .