I'm trying to call a class method from C. I've tried all combinations of
rb_intern I could think of to make it work, but I've gotten nothing.
Example class
class CallTest
def go
(do something here)
end
end
rb_funcall(?, rb_intern("go"), 0);
What goes in the ? space? I know if I use Qnil there, it will call
global functions, but I'd prefer class methods.
Am I heading in the wrong direction?
Also, I'd prefer not to have to know the class name ahead of time if
possible, but if I have to require that I know what it is, I can try
passing it by name to my application.
On Thu, Jan 22, 2009 at 2:11 PM, Robert Rouse <scyllinice@scyllinice.com> wrote:
Hello,
I'm trying to call a class method from C. I've tried all combinations of
rb_intern I could think of to make it work, but I've gotten nothing.
Example class
class CallTest
def go
(do something here)
end
end
rb_funcall(?, rb_intern("go"), 0);
What goes in the ? space? I know if I use Qnil there, it will call
global functions, but I'd prefer class methods.
Am I heading in the wrong direction?
Also, I'd prefer not to have to know the class name ahead of time if
possible, but if I have to require that I know what it is, I can try
passing it by name to my application.
On Thu, Jan 22, 2009 at 2:11 PM, Robert Rouse <scyllinice@scyllinice.com> wrote:
Hello,
I'm trying to call a class method from C. I've tried all combinations of
rb_intern I could think of to make it work, but I've gotten nothing.
Example class
class CallTest
def go
(do something here)
end
end
rb_funcall(?, rb_intern("go"), 0);
What goes in the ? space? I know if I use Qnil there, it will call
global functions, but I'd prefer class methods.
Am I heading in the wrong direction?
Also, I'd prefer not to have to know the class name ahead of time if
possible, but if I have to require that I know what it is, I can try
passing it by name to my application.