Skip to content

Instantly share code, notes, and snippets.

@zachinglis
Created April 1, 2009 21:30
Show Gist options
  • Save zachinglis/88904 to your computer and use it in GitHub Desktop.
Save zachinglis/88904 to your computer and use it in GitHub Desktop.
>> a
=> ["joe", "pass"]
>> h = {}
=> {}
>> a.each_with_index do |b, i|
?> h[i] = b
>> end
=> ["joe", "pass"]
>> h
=> {0=>"joe", 1=>"pass"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment