Sha256: 3e666ee6509aee523f5149d932355212eec033a5112c765d07208d26461c6c9e

Contents?: true

Size: 374 Bytes

Versions: 16

Compression:

Stored size: 374 Bytes

Contents

class Valvat
  module Checksum
    class IT < Base
      def validate
        y = figures_str[7..9].to_i
        y >= 1 && (y <= 100 || [120, 121].include?(y)) &&
        figures_str[0..6] != "0000000" &&
        super
      end

      def check_digit
        chk = 10 - sum_of_figures_for_at_es_it_se(true).modulo(10)
        chk == 10 ? 0 : chk
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
valvat-1.0.1 lib/valvat/checksum/it.rb
valvat-1.0.0 lib/valvat/checksum/it.rb
valvat-0.9.1 lib/valvat/checksum/it.rb
valvat-0.9.0 lib/valvat/checksum/it.rb
valvat-0.8.2 lib/valvat/checksum/it.rb
valvat-0.8.1 lib/valvat/checksum/it.rb
valvat-0.8.0 lib/valvat/checksum/it.rb
valvat-0.7.4 lib/valvat/checksum/it.rb
valvat-0.7.3 lib/valvat/checksum/it.rb
valvat-0.7.2 lib/valvat/checksum/it.rb
valvat-0.7.1 lib/valvat/checksum/it.rb
valvat-0.7.0 lib/valvat/checksum/it.rb
valvat-0.6.11 lib/valvat/checksum/it.rb
valvat-0.6.10 lib/valvat/checksum/it.rb
valvat-0.6.9 lib/valvat/checksum/it.rb
valvat-0.6.8 lib/valvat/checksum/it.rb