Class: CommonNumbers::Regon9

Inherits:
Base
  • Object
show all
Defined in:
lib/common_numbers/regon9.rb

Instance Attribute Summary

Attributes inherited from Base

#length, #magick_array, #magick_number, #mask, #modulo, #regexp

Instance Method Summary collapse

Methods inherited from Base

#checksum, #valid?, #validate, #validate_length, #validate_regexp, #validate_sum_control

Constructor Details

#initialize(num) ⇒ Regon9

Returns a new instance of Regon9.



4
5
6
7
8
9
10
11
# File 'lib/common_numbers/regon9.rb', line 4

def initialize(num)
  super num
  @mask = [8, 9, 2, 3, 4, 5, 6, 7]
  @modulo = 11
  @regexp = /^\d{9}$/
  @length = 9

end