From: Ruby Mania Date: 2012-10-15T06:04:29+09:00 Subject: Re: how to join the return of array Thanks a bunch ! This works like a charm but just curious why I have to initialize and I could not just do out[symb] << hq.close without initialize Henry Maddocks wrote in post #1079818: > out = Hash.new do {|h,v| h[v] = []} > > YahooFinance::get_HistoricalQuotes( symb, Date.parse('2012-10-06'), > Date.today() ) do |hq| > puts "#{symb} -> #{hq.close}" > out[symb] << hq.close > end > > Henry -- Posted via http://www.ruby-forum.com/.