From: Robert Rouse Date: 2009-01-23T04:34:21+09:00 Subject: Re: Calling class methods from C Jason Roelofs wrote: > Bah, saw a small issue right when I hit "Send". > > My call line works for a class defined as such: > > class CallTest > def self.go > (do something here) > end > end > > If you need to call an instance method on an instance of the class > CallTest, you need to of course get a hold of that instance, or make a > new one: > > VALUE obj = rb_funcall(rb_const_get("CallTest"), rb_intern("new"), 0); > rb_funcall(obj, rb_intern("go"), 0); > > Jason I tried using rb_const_get but it doesn't appear to call the method. What should I use for those parameters (VALUE and ID)? -- Posted via http://www.ruby-forum.com/.