Created
October 28, 2015 13:23
-
-
Save jaeming/d7d425292cbfb0907ab2 to your computer and use it in GitHub Desktop.
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
def list names | |
name_list = names.map(&:values).flatten | |
if name_list.length > 1 | |
with_ampersand = " & #{name_list.pop}" | |
solution = name_list.join(', ') << with_ampersand | |
else | |
solution = name_list.join | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment