From: Simon Strandgaard Date: 2003-11-17T10:22:14+09:00 Subject: Re: overload method in module_eval, how? On Mon, 10 Nov 2003 13:47:46 +0100, ts wrote: >>>>>> "S" == Simon Strandgaard writes: > > S> Though, now I don't understand why my example didn't work? > > Because the new method that you have defined was > > def test_x(*a, b) > end > > This give an arity -1, and runit reject these methods it keep only methods > with a zero arity > > > S> How to make it general so it works for an arbitrary number of arguments ? > > You *can't* give an arbitrary number of arguments for a test method DrainBammage, thats obvious. Thanks. BTW: I wonder why the last "p instance_methods" doesn't output anything? -- Simon Strandgaard server> ruby test_dbg.rb ["test_x"] Loaded suite test_dbg Started .. Finished in 0.002346 seconds. 1 tests, 1 assertions, 0 failures, 0 errors server> expand -t2 test_dbg.rb require 'test/unit' class Object def self.debug(*args) p instance_methods(false) args.each{|method| name = method.id2name org = "_debug_"+name arguments = (method.arity > 0) ? "(*a,&b)" : "(&b)" code=<