Class: Valvat::Checksum::Base
- Inherits:
-
Object
- Object
- Valvat::Checksum::Base
- Defined in:
- lib/valvat/checksum.rb
Direct Known Subclasses
AT, BE, BG, CY, DE, DK, EE, ES, FI, FR, GB, GR, HR, HU, IE, IT, LT, LU, MT, NL, PL, PT, RO, SE, SI
Instance Attribute Summary collapse
-
#vat ⇒ Object
readonly
Returns the value of attribute vat.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(vat) ⇒ Base
constructor
A new instance of Base.
- #validate ⇒ Object
Constructor Details
#initialize(vat) ⇒ Base
Returns a new instance of Base.
13 14 15 |
# File 'lib/valvat/checksum.rb', line 13 def initialize(vat) @vat = vat end |
Instance Attribute Details
#vat ⇒ Object (readonly)
Returns the value of attribute vat.
6 7 8 |
# File 'lib/valvat/checksum.rb', line 6 def vat @vat end |
Class Method Details
.check_digit_length(len = nil) ⇒ Object
8 9 10 11 |
# File 'lib/valvat/checksum.rb', line 8 def self.check_digit_length(len = nil) @check_digit_length = len if len @check_digit_length || 1 end |
Instance Method Details
#validate ⇒ Object
17 18 19 |
# File 'lib/valvat/checksum.rb', line 17 def validate check_digit == given_check_digit end |