From: Julian 'Julik' Tarkhanov Date: 2006-08-07T02:10:19+09:00 Subject: Re: How to react on nil or wrong object-type as parameter On 6-aug-2006, at 17:52, Yochen Gutmann wrote: > unless obj.respond_to? :to_str,:another_method, :yet_another_method, > :and_again_another_method basically it's easy (and common) to raise in such a case, but there is a quick plumbing trick def explode_reactor(bomb) bomb.activate rescue nil end This will activate the bomb and return nil if it raises (as the thing raised will most likely be a NoMethodError). -- Julian 'Julik' Tarkhanov please send all personal mail to me at julik.nl