From: Dave Thomas Date: 2000-12-28T02:10:02+09:00 Subject: [ruby-talk:8128] Re: Method as block to method "Nathaniel Talbott" writes: > I find myself wanting to pass a method as the block to another method on a > fairly regular basis, and I don't really like how the code turns out. > Currently it looks like this: > > result.addFaultListener(self, &(method(:addFault).to_proc)) Rather than adding a method, why not add an observer class? include "observer" class Handler def update(args...) # ... end end result.add_observer(Handler.new) # if the handler is anonymous or handler = Handler.new # if the handler is shared result_one.add_observer(handler) result_two.add_observer(handler) Regards Dave