From: Kristof Bastiaensen Date: 2004-10-10T04:39:47+09:00 Subject: Re: Help with a C extension On Sun, 10 Oct 2004 04:01:31 +0900, Eric Merritt wrote: >> Get a handle to the String class and use rb_define_method > > Thats the question, how do you get a handle to an existing class. I > see plenty of documentation on how to create a class, but not how to get a > handle on an existing class. > The VALUE for String is rb_cString, and is defined in ruby.h. If it wasn't there you could always get the class through Object: rb_const_get(rb_cObject, rb_intern("String")); Regards, Kristof