From: Joel VanderWerf Date: 2008-06-27T06:36:51+09:00 Subject: Re: A cleaner way to pass a block or proc Tristin Davis wrote: > def add_notifier(notifier=nil, &block) > raise ArgumentError, "Nil notifier. You must provide a Proc or a > block" if notifier.nil? && block.nil? > @notifiers << (notifier || block) > end A little less redundant... def add_notifier(notifier=nil, &block) @notifiers << (notifier || block || ( raise ArgumentError, "Nil notifier. You must provide a Proc or a block" )) end -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407