From: Tony Arcieri Date: 2010-05-14T01:21:20+09:00 Subject: Re: idiomatic way to pass multiple Procs/lambdas/blocks --000e0cd4a75cfc59d504867c252d Content-Type: text/plain; charset=ISO-8859-1 I like using symbols that identify named methods, personally On Thu, May 13, 2010 at 10:03 AM, Chuck Remes wrote: > I am working on a little syntactical sugar library for 0mq (networking > library). One of the things I would like to provide is a set of asynchronous > send/recv methods for transmitting and receiving messages. The method > signature would look something like this: > > def send message, timeout = -1, callback, errback > end > > where... > > +timeout+ is the number of seconds to wait before triggering the +errback+ > Proc; -1 disables timeouts > > +callback+ is the Proc/method/lambda executed upon acknowledged completion > > +errback+ is the Proc/method/lambda executed upon timeout > > > Ruby doesn't allow for passing multiple blocks to a method so I'm faced > with passing Procs or methods. > > Is there a more idiomatic way to accomplish my intentions? > > cr > > > -- Tony Arcieri Medioh! A Kudelski Brand --000e0cd4a75cfc59d504867c252d--