From: ole __ Date: 2008-01-04T09:14:33+09:00 Subject: Re: "wrong number of arguments" What? I must be thick or somethi > Yes, but he hadn't gotten to that point yet. Right. And I only posted a cut down version of the code. NilObject is defined in the full version. > @nested = nested || NilObject.new > > won't work, and is probably unnecessary. Interesting. Let me make certain you understand my intentions first. NilObject looks like this: class NilObject def method_missing(name, *params); end end It just swallows messages. It is an implementation of the Introduce Null Object refactor http://www.refactoring.com/catalog/introduceNullObject.html This means that I don't have to continuously repeat checks for nil. It's explained a bit better here http://www.industriallogic.com/xp/refactoring/nullObject.html This is a concept that has come straight out of Java so I'm interested if there is a more ruby way of doing such things. -- Posted via http://www.ruby-forum.com/.