Permalink
Browse files

add to_normalized_phone

  • Loading branch information...
herestomwiththeweather committed Apr 29, 2012
1 parent 50620e2 commit 07e668e72e33407c0387d8325b3c944656c91d3b
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/string.rb
View
@@ -17,6 +17,10 @@ def normalize_phone!
self.gsub!(/^[1]/, "")
end
+ def to_normalized_phone
+ self.gsub(/\D/, "").gsub(/^[1]/, "")
+ end
+
def remove_html
tokenizer = HTML::Tokenizer.new(self)
result = ""

0 comments on commit 07e668e

Please sign in to comment.