Sha256: 533bb5b30dc941294108c4fe9610712fb494745f05283e4dcb1dc364bfd9d2de

Contents?: true

Size: 431 Bytes

Versions: 8

Compression:

Stored size: 431 Bytes

Contents

require 'valvat/checksum'

class Valvat
  module Checksum
    class SE < Base
      check_digit_length 0

      def validate
        vat.to_s_wo_country[-2..-1].to_i > 0 &&
        super
      end

      private

      def check_digit
        sum_of_figures_for_at_es_it_se.modulo(10)
      end

      def given_check_digit
        0
      end

      def str_wo_country
        vat.to_s_wo_country[0..9]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
valvat-0.6.7 lib/valvat/checksum/se.rb
valvat-0.6.6 lib/valvat/checksum/se.rb
valvat-0.6.5 lib/valvat/checksum/se.rb
valvat-0.6.4 lib/valvat/checksum/se.rb
valvat-0.6.3 lib/valvat/checksum/se.rb
valvat-0.6.2 lib/valvat/checksum/se.rb
valvat-0.6.1 lib/valvat/checksum/se.rb
valvat-0.6.0 lib/valvat/checksum/se.rb