I’m just making my first C extension and have a question about creating
a reference to a ruby variable, that’s passed as a method parameter to
equivalent of initialize. I need this variable to be available after the
method has exited because I wan’t to call methods on the class
represented by that variable.
This is what I’ve done so far after reading the README.EXT etc,
static VALUE ref;
/* The initialize method. */
static VALUE init(VALUE self, VALUE arg)
ref = arg;
Then later on I wan’t to use it like this:
rb_funcall(ref, rb_intern(“some_method”), 0, 0);
Is this the right way to do it or should I solve the problem in another
Greatful for a fast reply!