Thanks, a lot! Especially for the fast response. That's exactly what I needed. (I'm trying to use ruby as a driver for a test suite of my C++ code so I can script the tests.) I think with your example in hand I'll be able to get it working by Monday. :) I owe you one. -- Chris ts <decoux / moulon.inra.fr> writes: > static VALUE tt_cX; > > static VALUE > tt_example(self) > VALUE self; > { > VALUE res = rb_funcall(tt_cX, rb_intern("new"), 0, 0); > rb_ivar_set(res, rb_intern("@x"), INT2NUM(111)); > rb_ivar_set(res, rb_intern("@y"), INT2NUM(222)); > rb_ivar_set(res, rb_intern("@z"), INT2NUM(333)); > return res; > } > > void Init_tt() > { > rb_require("x"); > tt_cX = rb_const_get(rb_cObject, rb_intern("X")); > rb_define_singleton_method(tt_cX, "example", tt_example, 0);