lib/br_documents/ie/ac.rb in br_documents-0.1.3 vs lib/br_documents/ie/ac.rb in br_documents-0.2.0
- old
+ new
@@ -1,17 +1,18 @@
-require_relative "pattern2"
+require_relative 'pattern2'
module BrDocuments
module IE
class AC < Pattern2
def initialize(number)
super
@mask = /^(\d{2}\.\d{3}\.\d{3}\/\d{3}\-\d{2})$|^(\d{13})$/
end
private
+
def format_ie(number)
- number.sub(/(\d{2})(\d{3})(\d{3})(\d{3})(\d{2})/, "\\1.\\2.\\3/\\4-\\5")
+ number.sub(/(\d{2})(\d{3})(\d{3})(\d{3})(\d{2})/, '\\1.\\2.\\3/\\4-\\5')
end
end
end
end