Class: BankingDataValidator::Bank::Base
- Inherits:
-
Object
- Object
- BankingDataValidator::Bank::Base
show all
- Defined in:
- lib/banking_data_validator/bank/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(branch, account_number, account_digit) ⇒ Base
Returns a new instance of Base.
8
9
10
11
12
|
# File 'lib/banking_data_validator/bank/base.rb', line 8
def initialize(branch, account_number, account_digit)
@branch = padding_with_zeros(branch, 4)
@account_number = padding_with_zeros(account_number)
@account_digit = padding_with_zeros(account_digit)
end
|
Class Method Details
.valid_account?(branch, account_number, account_digit) ⇒ Boolean
4
5
6
|
# File 'lib/banking_data_validator/bank/base.rb', line 4
def self.valid_account?(branch, account_number, account_digit)
new(branch, account_number, account_digit).valid_account?
end
|
Instance Method Details
#valid_account? ⇒ Boolean
14
15
16
|
# File 'lib/banking_data_validator/bank/base.rb', line 14
def valid_account?
@account_digit.upcase == checksum
end
|