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/. >