Created
November 20, 2010 13:03
-
-
Save qxjit/707805 to your computer and use it in GitHub Desktop.
Sending messages in ruby on new line without a trailing '.'
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
| # This program prints out: | |
| # | |
| # Reversed: god | |
| # God | |
| # | |
| # I originally found it in the documentation | |
| # of BasicObject#tap in "Programming Ruby 1.9" by Dave Thomas | |
| # | |
| puts "dog" | |
| .reverse | |
| .tap {|o| puts "Reversed: #{o}"} | |
| .capitalize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment