Class: BrDocuments::IE::PE::PE9

Inherits:
BrDocuments::IE::Pattern2 show all
Defined in:
lib/br_documents/ie/pe.rb

Instance Method Summary collapse

Methods included from Commons::Mod11

#generate_digital_check, #reduce_weights

Methods inherited from Base

#formatted, #valid?

Constructor Details

#initialize(number) ⇒ PE9

Returns a new instance of PE9.



38
39
40
41
42
43
# File 'lib/br_documents/ie/pe.rb', line 38

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