From: Paul Brannan Date: 2002-01-09T00:15:04+09:00 Subject: Re: chaining methods On Wed, Jan 09, 2002 at 12:08:34AM +0900, Tobias Reif wrote: > I'd like to be able to write > r.width=5.height=6 > , but then the receiver of height= is 5. > > So I have to write > (r.width=5).height=6 > ; the first expression returns a Rect. > > def height= value > add_attributes('height'=>value.to_s) > self > end When I look at this, it confuses me. First of all, why does r.width=5 return a Rect? I think it should return 5, otherwise I cannot do: r.width = r.height = 42 As a solution, just use two separate statements. It will be easier to read and less of a headache later on when you are trying to figure out what this does. Paul