D
Dwayne Achee
While writing a C extension to Ruby, I'm trying to call a singleton
method that resides in another class but can't figure out what
parameters to give to rb_funcall() to do this. The problem boils down
to this:
class MyClass
def MyClass.my_func
...
end
end
and then in a Ruby extension, in C, I'm trying to call MyClass.my_func
using rb_funcall(), but I can't tell what the 'receiver' and 'id'
parameters should be:
rb_funcall(VALUE receiver, ID id, int argc, ...)
Note that I'm creating another Ruby class in my C extension, *not*
extending MyClass. I checked the FAQ but couldn't find anything
close, and couldn't quite figure it out from the "Programming Ruby"
book.
Thanks for any help,
Dwayne
method that resides in another class but can't figure out what
parameters to give to rb_funcall() to do this. The problem boils down
to this:
class MyClass
def MyClass.my_func
...
end
end
and then in a Ruby extension, in C, I'm trying to call MyClass.my_func
using rb_funcall(), but I can't tell what the 'receiver' and 'id'
parameters should be:
rb_funcall(VALUE receiver, ID id, int argc, ...)
Note that I'm creating another Ruby class in my C extension, *not*
extending MyClass. I checked the FAQ but couldn't find anything
close, and couldn't quite figure it out from the "Programming Ruby"
book.
Thanks for any help,
Dwayne