Ruby interpreter = script.getInterpreter();
assertTrue("Collector not defined", interpreter.isClassDefined("Collector"));
RubyClass collectorClass = interpreter.getClass("Collector");
IRubyObject presult = JavaEmbedUtils.javaToRuby(interpreter, result);
IRubyObject collector = collectorClass.newInstance(interpreter.getCurrentContext(), new IRubyObject[0], null);
IRubyObject rubyObject = interpreter.evalScriptlet("proc { my_function }");
try {
collector.callMethod(interpreter.getCurrentContext(), "callprotected", new IRubyObject[] { rubyObject, presult });
} catch (Throwable t) {
}