Created
January 5, 2011 20:20
-
-
Save vijaydev/766944 to your computer and use it in GitHub Desktop.
Ruby
This file contains 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
"ensure" makes sure code is run regardless of begin-rescue outcome. (equivalent of Java finally) | |
Pass a number parameter to Array#first and Array#last to get the first n or the last n values. | |
http://rubyquicktips.tumblr.com/post/870337608/grep-anything-from-your-enumerables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment