From: Eric Merritt Date: 2004-10-10T06:20:44+09:00 Subject: Re: Help with a C extension Ah! thank you so much! On Sun, 10 Oct 2004 04:39:47 +0900, Kristof Bastiaensen wrote: > 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 > > -- I'm a programmer, I don't have to spell correctly; I just have to spell consistently