From: Luis Velasco Date: 2011-09-29T08:44:22+09:00 Subject: Re: Ruby Syntax @keywords ||= [ ] This would be the same as: @keywords = @keywords || [] If @keywords has something, use it, else, use [] El 28/09/2011, a las 12:07, Bhavesh Sharma escribió: > Sorry if this comes across as a dumb question, but what does the > following syntax mean in ruby. > > @keywords ||= [] > > I understand that its setting the instance variable as an array but what > is the logical operator '||' doing in there. > > -- > Posted via http://www.ruby-forum.com/. >