Skip to content

Instantly share code, notes, and snippets.

@ricdeez
Created January 29, 2013 06:58
Show Gist options
  • Save ricdeez/4662358 to your computer and use it in GitHub Desktop.
Save ricdeez/4662358 to your computer and use it in GitHub Desktop.
Ruby: List in Words
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