From: Tim Hunter Date: 2008-09-19T21:23:31+09:00 Subject: Re: rb_include_module() doesn't call Module#included unknown wrote: > Tim Hunter wrote: >> >> You could use rb_funcall instead. >> > > Thanks for your reply, Tim. > But I'm not sure you mean something like this : > > VALUE args [1] = { rb_str_new2("Serializable") }; > rb_funcall( klass, rb_intern("include"), 1, args ); > > Am I correct ? The argument to include is a module, not a string, so you'll need to pass the Serializable module VALUE instead of the string "Serializable". If you've defined Serializable in C, then that would be the return value from rb_define_module_under (or whatever function you called to define Serializable). If you've defined Serializable in Ruby, then you'll have to call rb_const_get get the value of Serializable. -- Posted via http://www.ruby-forum.com/.