lib/br_documents/ie/ba.rb in br_documents-0.2.0 vs lib/br_documents/ie/ba.rb in br_documents-0.2.1
- old
+ new
@@ -7,10 +7,10 @@
include Commons::Mod11
protected
def format_ie(number)
- if number.gsub(/-/, '').length == 8
+ if number.delete('-').length == 8
number.sub(/(\d{6})(\d{2})/, '\\1-\\2')
else
number.sub(/(\d{7})(\d{2})/, '\\1-\\2')
end
end