Skip to content

Instantly share code, notes, and snippets.

@jaeming
Created October 28, 2015 13:23
Show Gist options
  • Save jaeming/d7d425292cbfb0907ab2 to your computer and use it in GitHub Desktop.
Save jaeming/d7d425292cbfb0907ab2 to your computer and use it in GitHub Desktop.
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