Created
May 27, 2013 09:50
-
-
Save Olefine/5656202 to your computer and use it in GitHub Desktop.
last elemnts in array using slice and join into string using |
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
def few2last(array) | |
array.slice(-2..-1).join("|") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment