Created
September 11, 2012 14:36
-
-
Save KellyMahan/3699188 to your computer and use it in GitHub Desktop.
What I learned today
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
| #something i learned today that I didn't know was possible in ruby. | |
| array_of_long_pasted_in_strings = [<<FOO, <<BAR, <<BLATZ] | |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. | |
| FOO | |
| Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum | |
| BAR | |
| I recently discovered that I can use multiple heredocs as parameters. | |
| Isn't that neat? Because almost nothing needs to be escaped with heredocs, I prefer to use it when strings are pasted in from elsewhere. Because the syntax for using it inside parameter lists is so nice, I prefer to use it whenever a multiline string literal is being passed into something as an argument. | |
| BLATZ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment