Created
October 29, 2012 10:02
-
-
Save berkes/3972710 to your computer and use it in GitHub Desktop.
String.tenderloverized
This file contains hidden or 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
| class String | |
| # http://confreaks.com/videos/1228-aloharuby2012-keynote-rails-4-and-the-future-of-web | |
| def t13d | |
| if length > 2 | |
| return "#{self[0,1]}#{(length - 2)}#{self[-1,1]}" | |
| else | |
| return self | |
| end | |
| end | |
| end | |
| "tenderloverized".t13d #=> t13d | |
| "parrallellizzattion".t13d #=> "p17n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment