Class: Valideez::Iban
- Includes:
- Common
- Defined in:
- lib/valideez/iban.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(val, options = {}) ⇒ Iban
constructor
A new instance of Iban.
- #validate_sum_control ⇒ Object
Methods included from Common
#validate_format, #validate_length
Methods inherited from Base
Constructor Details
#initialize(val, options = {}) ⇒ Iban
Returns a new instance of Iban.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/valideez/iban.rb', line 5 def initialize(val, = {}) super val assign({ format: /\A[A-Z][A-Z]\d{26}\Z/, length: 28, modulo: 97, sum_control: true, }.merge()) @arr = [] end |
Instance Method Details
#validate_sum_control ⇒ Object
18 19 20 21 |
# File 'lib/valideez/iban.rb', line 18 def validate_sum_control mod = checksum % modulo mod === 1 end |