Created
February 11, 2013 14:09
-
-
Save taf2/4754606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Phony | |
class << self | |
alias_method :split_default, :split | |
def split(phone_number) | |
split_default(phone_number).map {|part| | |
puts "#{part.class.inspect} -> #{part.inspect}" | |
if !part.is_a?(Fixnum) && !part.is_a?(String) || (part.respond_to?(:match) && part.match(/Phony::/)) | |
part = nil | |
end | |
part | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if this would cover all the bases as well?