Created
December 6, 2010 03:21
-
-
Save jedschneider/729790 to your computer and use it in GitHub Desktop.
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
| :hello + "world" rescue "say what?" #=> "say what?" | |
| # so we can do the normal thing | |
| :hello.to_s + "world" #=> "hello world" | |
| "#{:hello} world" #=> "hello world" | |
| # or we can have fun | |
| class Symbol | |
| def +(arg) | |
| [to_s, arg].join(" ") | |
| end | |
| end | |
| :hello + "world" #=> "hello world" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment