lib/validates_cpf/cpf.rb in validates_cpf-2.0.0.rc2 vs lib/validates_cpf/cpf.rb in validates_cpf-2.0.0
- old
+ new
@@ -8,11 +8,11 @@
@cleaned_number = @pure_number.nil? ? nil : @number.gsub(/[\.-]/, "")
format_number! if @pure_number
end
def valid?
- return true if @number.nil?
+ return true if @number.blank?
return false unless @pure_number
check_cpf
end
def number
@@ -49,6 +49,6 @@
def format_number!
@cleaned_number =~ /(\d{3})(\d{3})(\d{3})(\d{2})/
@number = "#{$1}.#{$2}.#{$3}-#{$4}"
end
end
-end
\ No newline at end of file
+end