Created
January 29, 2013 06:58
-
-
Save ricdeez/4662358 to your computer and use it in GitHub Desktop.
Ruby: List in Words
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
print "#{doc}: " | |
print "#{data.size > 1 ? data[0..-2].join(", ") : ""}#{data.size > 1 ? " and " : "" }#{data[-1].join("")}" if data.size > 0 | |
print "None" if data.size == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment