>>>>> "D" == Dwayne Achee <dachee1@yahoo.com> writes:
D> class MyClass
D> def MyClass.my_func
D> ...
D> end
D> end
D> and then in a Ruby extension, in C, I'm trying to call MyClass.my_func
D> using rb_funcall(), but I can't tell what the 'receiver' and 'id'
D> parameters should be:
D> rb_funcall(VALUE receiver, ID id, int argc, ...)
The receiver is MyClass, to retrieve it (if you don't have a reference)
just do
VALUE myclass = rb_const_get(rb_cObject, rb_intern("MyClass"));
then to call the method MyClass::my_func(12) just write
rb_funcall(myclass, rb_intern("my_func"), 1, INT2NUM(12));
--
Guy Decoux