From: Charles Mills Date: 2004-10-10T08:26:08+09:00 Subject: Re: Help with a C extension This is helpful too: VALUE rb_path2class _((const char*)); assert(rb_cString == rb_path2class("String")); assert(rb_cArray == rb_path2class("Array")); assert(cMyClass == rb_path2class("MyModule::MyClass")); -Charlie On Oct 9, 2004, at 3:29 PM, rcoder wrote: > You should be able to define extension methods for built-in classes the > same way you do for your own module. > > For example: > > VALUE my_extension_method(VALUE klass, VALUE self) { > /* do something here... */ > return Qnil; > } > > void Init_my_extension() { > rb_define_method(rb_cString, "my_method_name", my_extension_method, > 0); > } > > -- > Lennon > rcoder.net > >