diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-03 19:53:45 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-03 20:26:56 -0200 |
commit | da507b71f66bca61d06328a876ac1b1482e8fb81 (patch) | |
tree | 5d69fc106fe42955e6fb487f5fba35c363f9e47c /activesupport/lib | |
parent | 55afd62f2364cf86a697b7fe9913a05c2157ac92 (diff) | |
download | rails-da507b71f66bca61d06328a876ac1b1482e8fb81.tar.gz rails-da507b71f66bca61d06328a876ac1b1482e8fb81.tar.bz2 rails-da507b71f66bca61d06328a876ac1b1482e8fb81.zip |
No need for #tap
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/number_helper/number_to_phone_converter.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb b/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb index ac51ceabc1..300924bded 100644 --- a/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb +++ b/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb @@ -23,10 +23,9 @@ module ActiveSupport end def convert_without_area_code(number) - number.tap { |n| - n.gsub!(/(\d{0,3})(\d{3})(\d{4})$/,"\\1#{delimiter}\\2#{delimiter}\\3") - n.slice!(0, 1) if begins_with_delimiter?(n) - } + number.gsub!(/(\d{0,3})(\d{3})(\d{4})$/,"\\1#{delimiter}\\2#{delimiter}\\3") + number.slice!(0, 1) if begins_with_delimiter?(number) + number end def begins_with_delimiter?(number) |