From: Jack Bauer Date: 2010-02-02T02:35:51+09:00 Subject: Adding keys to a hash in a loop Hi all, I'm trying to essentially accomplish this behavior: output.each do |item| output_hash << {item.name => []} end So that I can end up with: {"first_set" => [], "second_set" => [], "third_set" => [], ... } I know the first block of code won't work, but it's just to illustrate what it is I wish to accomplish. Can anyone help me out? Thanks. -- Posted via http://www.ruby-forum.com/.