From: RichardOnRails Date: 2011-03-01T14:25:25+09:00 Subject: Re: Comining Arrays On Feb 28, 11:05 pm, Sam Duncan wrote: > And just to be sure, with 1.8.7 ... > > irb(main):001:0> RUBY_VERSION > => "1.8.7" > irb(main):002:0> %w( a b c ) > => ["a", "b", "c"] > irb(main):003:0> %w( a b c ).kind_of?(String) > => false > irb(main):004:0> %w( a b c ).kind_of?(Array) > => true > > On 01/03/11 17:01, Sam Duncan wrote: > > > On 01/03/11 16:45, RichardOnRails wrote: > > >> Hey David, > > >> Neat code,  but I don't get it. > > >> %w( a b c ) yields an instance of class String. > > > ruby-1.9.2-p0 > %w( a b c ) > >  => ["a", "b", "c"] > > ruby-1.9.2-p0 > %w( a b c ).kind_of?(String) > >  => false > > ruby-1.9.2-p0 > %w( a b c ).kind_of?(Array) > >  => true > > Hi Sam, Thanks. My mind stopped this the thought that %w creates strings out of bare words. I forgot that those strings end up in an array. I should have checked that my stupid claim was correct before posting. So, with an apology to you and the newsgroup, Best wishes, Richard