Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Created August 28, 2014 15:03
Show Gist options
  • Save pumpkincouture/04bc9ab304be5075ca93 to your computer and use it in GitHub Desktop.
Save pumpkincouture/04bc9ab304be5075ca93 to your computer and use it in GitHub Desktop.
def assign_santa(list)
pairs = []
list.each_cons(2) do |hash, next_hash|
pairs << [hash["FIRST_NAME"] + " " + hash["LAST_NAME"] + " + " + next_hash["FIRST_NAME"] + " " + next_hash["LAST_NAME"]]
end
first_name = list[0]
last_name = list[-1]
pairs << [last_name["FIRST_NAME"] + " " + last_name["LAST_NAME"] + " + " + first_name["FIRST_NAME"] + " " + first_name["LAST_NAME"]]
pairs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment