Forum: Ruby ruby_top_self in 1.9

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-06-07 05:43
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
This topic is locked and can not be replied to.