From: Ruby Mania Date: 2012-10-15T06:19:43+09:00 Subject: Re: how to join the return of array Superb ! thnx ! I was mising on such a small concept :( Henry Maddocks wrote in post #1079820: > Because the default value of an uninitialised hash key is nil and nil > doesn't respond to << > > >>> out = {} > => {} >>> out['foo'] > => nil >>> out['foo'] << 'bar' > NoMethodError: undefined method `<<' for nil:NilClass > from (irb):3 > from /Users/henry/.rbenv/versions/1.9.3-p125/bin/irb:12:in `
' >>> > > > Henry -- Posted via http://www.ruby-forum.com/.