From: Philipp Hofmann Date: 2008-02-25T07:58:01+09:00 Subject: Re: Suprising behaviour with "def property=" method On Mon, Feb 25, 2008 at 07:41:31AM +0900, Farrel Lifson wrote: > I had a bit of a surprise with the following > > class Foo > def bar(value) > @bar = value.upcase > end > end > > f = Foo.new > my_bar = (f.bar = "bar") > > I initially thought that my_bar would == "BAR" but in fact it equals > "bar". It seems no matter what the final value of the bar= method is > the return value is always the parameters. First time I've run into > this so I thought I would share and ask if anyone can think of anyway > to get around this? > > Farrel > my_bar = f.send(:bar=, "bar") g phil