Sha256: 1ac5855e4f41d832b8bee717d09424effa3e4b2282cac6f3f638b66801d22375

Contents?: true

Size: 349 Bytes

Versions: 6

Compression:

Stored size: 349 Bytes

Contents

require_relative 'pattern1'

module BrDocuments
  module IE
    class RS < Pattern1
      def initialize(number)
        super
        @mask = /^(\d{3}\/\d{7})$|^(\d{10})$/
        @weight = [2, 9, 8, 7, 6, 5, 4, 3, 2]
      end

      private

      def format_ie(number)
        number.sub(/(\d{3})(\d{7})/, '\\1/\\2')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
br_documents-0.2.5 lib/br_documents/ie/rs.rb
br_documents-0.2.4 lib/br_documents/ie/rs.rb
br_documents-0.2.3 lib/br_documents/ie/rs.rb
br_documents-0.2.2 lib/br_documents/ie/rs.rb
br_documents-0.2.1 lib/br_documents/ie/rs.rb
br_documents-0.2.0 lib/br_documents/ie/rs.rb