lib/sec_id/isin.rb in sec_id-3.0.0 vs lib/sec_id/isin.rb in sec_id-4.0.0
- old
+ new
@@ -6,11 +6,11 @@
ID_REGEX = /\A
(?<identifier>
(?<country_code>[A-Z]{2})
(?<nsin>[A-Z0-9]{9}))
(?<check_digit>\d)?
- \z/x.freeze
+ \z/x
attr_reader :country_code, :nsin
def initialize(isin)
isin_parts = parse isin
@@ -19,10 +19,10 @@
@nsin = isin_parts[:nsin]
@check_digit = isin_parts[:check_digit]&.to_i
end
def calculate_check_digit
- return mod_10(luhn_sum) if valid_format?
+ return mod10(luhn_sum) if valid_format?
raise InvalidFormatError, "ISIN '#{full_number}' is invalid and check-digit cannot be calculated!"
end
private