From: ara.t.howard@... Date: 2006-03-08T10:27:53+09:00 Subject: Re: Passing the same argument(s) to several methods at once On Wed, 8 Mar 2006, [ISO-8859-1] Iv�n Vega Rivera wrote: > Hi, > > I'm a Ruby beginner, but I remember I read somewhere something > related... Only at the time I didn't realize it's usefulness until > now. > > Maybe I'm mistaken, but is it possible to pass the same argument(s) to > several functions at once? > > Like: > > function_a 'something' > function_b 'something' > > Instead something like: > > 'something'.pass do |arg| > function_a arg > function_b arg > end > > Does that make sense? > > Thanks in advance! > > Ivan V. the general case is: %w( function_a function_b ).each{|m| receiver.send(m, *args, &block)} works for any number of args, any receiver, and any block or lack of. hth. -a -- judge your success by what you had to give up in order to get it. - h.h. the 14th dali lama