Class: BrDocuments::IE::PR

Inherits:
Pattern2 show all
Defined in:
lib/br_documents/ie/pr.rb

Instance Method Summary collapse

Methods included from Commons::Mod11

#generate_check_digit, #reduce_weights

Methods inherited from Base

#formatted, #valid?

Constructor Details

#initialize(number) ⇒ PR

Returns a new instance of PR.



6
7
8
9
10
11
# File 'lib/br_documents/ie/pr.rb', line 6

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