Class: BrDocuments::IE::Pattern1

Inherits:
Base
  • Object
show all
Includes:
Commons::Mod11
Defined in:
lib/br_documents/ie/pattern1.rb

Direct Known Subclasses

AL, AM, CE, ES, GO, MA, MS, MT, PA, PB, BrDocuments::IE::PE::PE14, PI, RJ, RR, RS, SC, SE, TO

Instance Method Summary collapse

Methods included from Commons::Mod11

#generate_digital_check, #reduce_weights

Methods inherited from Base

#formatted, #valid?

Constructor Details

#initialize(number) ⇒ Pattern1

Returns a new instance of Pattern1.



9
10
11
12
13
# File 'lib/br_documents/ie/pattern1.rb', line 9

def initialize(number)
  super
  @mask = /^(\d{8}\-\d{1})$|^(\d{9})$/
  @weight = [9, 8, 7, 6, 5, 4, 3, 2]
end