From: Ned Konz Date: 2001-09-01T03:22:32+09:00 Subject: [ruby-talk:20638] Re: Passing procedures On Friday 31 August 2001 11:09 am, Peter Hickman wrote: > I am building this class that takes a user defined procedure and then > applies it. The test code looks like this: > @process.call(self, "this", "that") but testfunc only takes two parameters... This works, but I'm not sure it's what you want... class TestClass def initialize(process) @process = process end def run() if @process == nil then puts "No process given" else @process.call("this", "that") end end end def testfunc(a, b) puts "1 -> #{a} 2 -> #{b}" end fred = TestClass.new(method("testfunc")) fred.run You may instead want to use send. -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com