From: Rick DeNatale Date: 2009-08-27T01:20:20+09:00 Subject: Re: ||= with 1.8 and 1.9 ? On Wed, Aug 26, 2009 at 11:08 AM, Brian Candler wrote: > In ruby 1.8, an attribute writer method (:foo=) always(*) returns the > value of its argument, rather than the last value calculated in the > method, so that you can tell by inspection that > >   a = foo.bar = 123 actually it's not that an attribute writer method always returns the argument it's that a chained assignment a = b = c is treated the same as b = c; a = c in other words the result of the b= is ignored. That's why sending :bar= is giving the result of the method. As for why Ruby1.9 is treating the ||= form differently, I haven't figured that out. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale