Ruby_top_self in 1.9


#1

with ruby 1.8 C code, I can (apparently) do the following to define a
top level method called “go”

file Test3.c

static void toplevel_scope_1(VALUE self, NODE *cref) {
VALUE s_class = (cref)->nd_clss;
rb_define_private_method(s_class, “go”, method_1, -1);
}

void Init_test3() {
NODE *cref = rb_node_newnode(NODE_CREF, rb_cObject, 0, 0);
toplevel_scope_1(ruby_top_self, cref);
}

So anybody have any clues how to do that in 1.9?
Thanks!
-=r