Ruby Forum Rails Spinoffs > Function.wrap

Posted by datvong@gmail.com (Guest)
on 15.05.2008 05:03
(Received via mailing list)
according to the documentation....

wrap(wrapperFunction[, arg...]) -> Function

i assumed that arg is where I can pass extra arguments to the wrapper
function.  but it doesn't seem to work.

what i'm trying to do is write a profiling function...
prof: function() {...}

and we have

func1.wrap(prof);
func2.wrap(prof);

but in order to differentiate between func1, and func2, i had...

func1.wrap(prof, 1)
func2.wrap(prof,2)

but this didn't seem to work...
Posted by kangax (Guest)
on 15.05.2008 07:01
(Received via mailing list)
I'm not exactly sure what you mean.
"wrapperFunction" is being passed reference to original function,
followed by arguments of original function.
How should func1 and func2 be differentiated?

- kangax