From: Xavier Noria Date: 2006-12-03T19:52:59+09:00 Subject: Re: Simple and stuppid bug (can anyone find it?) On Dec 3, 2006, at 11:35 AM, paul wrote: > Hi all, > I thought it to be good programming style to make attribute assignment > chainable. When using the attr_writer an assignment returns te value > assigned which is not what I want, so I tried to do-it-myself. > The result is below. This doesn't work. When running Ruby gives: > undefined method 'b=' for "AA":String (NoMethodError) > Anybody, please tell me: *why*. What simple stuppid thing am I > overseeing? That is explained on page 85 of the Pickaxe (113 in my PDF edition): "In older Ruby versions, the result of the assignment was the value returned by the attribute-setting method. In Ruby 1.8, the value of the assignment is always the value of the parameter; the return value of the method is discarded." -- fxn