Class: Jan::CheckDigit
- Inherits:
-
String
- Object
- String
- Jan::CheckDigit
- Defined in:
- lib/jan/check_digit.rb
Instance Method Summary collapse
-
#initialize(check_digit) ⇒ CheckDigit
constructor
A new instance of CheckDigit.
- #valid? ⇒ boolean
Constructor Details
#initialize(check_digit) ⇒ CheckDigit
Returns a new instance of CheckDigit.
4 5 6 7 |
# File 'lib/jan/check_digit.rb', line 4 def initialize(check_digit) @check_digit = check_digit super(check_digit) end |
Instance Method Details
#valid? ⇒ boolean
10 11 12 |
# File 'lib/jan/check_digit.rb', line 10 def valid? @check_digit.match?(/\A\d\z/) end |