Class: BankAccountNumberValidator::Validator::Pl
- Inherits:
-
BankAccountNumberValidator::Validator
- Object
- BankAccountNumberValidator::Validator
- BankAccountNumberValidator::Validator::Pl
- Defined in:
- lib/bank_account_number_validator/validator/pl.rb
Instance Method Summary collapse
-
#initialize(value: nil) ⇒ Pl
constructor
A new instance of Pl.
- #valid ⇒ Object
Constructor Details
#initialize(value: nil) ⇒ Pl
Returns a new instance of Pl.
2 3 4 5 |
# File 'lib/bank_account_number_validator/validator/pl.rb', line 2 def initialize value: nil @value = value_to_array value @weight = [1,10,3,30,9,90,27,76,81,34,49,5,50,15,53,45,62,38,89,17,73,51,25,56,75,71,31,19,93,57] end |
Instance Method Details
#valid ⇒ Object
7 8 9 10 11 12 |
# File 'lib/bank_account_number_validator/validator/pl.rb', line 7 def valid return false unless length_valid set_pl_code set_first_to_end remainder? end |