From: Josh Cheek Date: 2009-12-30T21:21:49+09:00 Subject: Re: How to pass a function as parameter? --000e0cd1b12455e852047bf12eda Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 30, 2009 at 6:08 AM, Fritz Trapper wrote: > Thanks for your quick replies. > > I see, my scenario is somewhat more complicated, than I wrote in my > initial posting. The point is, that I want to pass an object and a > method. > > Something like this: > > def executer(obj, method) > f.method(1) > end > > class x > def test(x) > p x > end > end > > o = x.new > executer(o, test) > -- > Posted via http://www.ruby-forum.com/. > > def executer(obj, method) obj.send method , 1 end class X def test(x) p x end end o = X.new executer( o , :test ) --000e0cd1b12455e852047bf12eda--