Skip to content

Instantly share code, notes, and snippets.

@minikomi
Created February 8, 2012 11:24
Show Gist options
  • Save minikomi/1768281 to your computer and use it in GitHub Desktop.
Save minikomi/1768281 to your computer and use it in GitHub Desktop.
Ruby zip unpacking
names = ['fred', 'bill']
ages = [33, 40]
locations = ['san francisco', 'dubai']
names.zip(ages, locations) do |n, a, l|
puts n
puts "lives in " + l
puts "is #{a} years old"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment