Aldric Giacomoni wrote:
> It works as indicated. Is this -normal- behavior ?

FWIW, I get identical results to you using

ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
ruby 1.9.2dev (2009-07-18 trunk 24186) [i686-linux]

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

will set a to 123. Perhaps it has been decided to change that for 1.9.

(*) Strangely, even 1.8 doesn't work that way if you use send().

>> RUBY_VERSION
=> "1.8.6"
>> class Foo; def bar=(x); 123; end; end
=> nil
>> Foo.new.bar = 999
=> 999
>> Foo.new.send(:bar=, 999)
=> 123
>> 
-- 
Posted via http://www.ruby-forum.com/.