From: Tobias Reif Date: 2002-01-09T00:45:50+09:00 Subject: Re: chaining methods David Alan Black wrote: > In #height=, > why add_attributes(...) instead of @height = value.to_s ? because add_attributes(...) does something else than assigning to @height. I could use @height, but that would be indirect and require a little more code in the specific context, AFAICS. In the superclass REXML::Element, it's defined as def add_attributes hash hash.each_pair {|key, value| @attributes[key] = value } end So I could do @attributes['height']=value.to_s or add_attributes('height'=>value.to_s) The second is 4 chars longer, but a bit more expressive IMHO. Tobi -- http://www.pinkjuice.com/