On Thu, Jun 26, 2008 at 3:04 AM, Joel VanderWerf
<vjoel / path.berkeley.edu> wrote:
> Tristin Davis wrote:
>>
>>  def add_notifier(notifier=nil, &block)
>>     if block_given?
>>        @notifiers << block
>>     else
>>        @notifiers << notifier
>>     end
>>  end
>
>  def add_notifier(notifier=nil, &block)
>     @notifiers << (block || notifier)
>  end

I would do it exactly as Jl suggested above, however there is an
interesting alternative one might want to be aware of

def add_notfier notifier=nil
    @notifiers << ( Proc::new rescue notifier)
end

Cheers
Robert


-- 
http://ruby-smalltalk.blogspot.com/

---
Les mes questions qu'on se pose
On part vers oet vers qui
Et comme indice pas grand-chose
Des roses et des orties.
-
Francis Cabrel