In article <007c01c30a90$9e798bc0$6401a8c0@MELONBALLER>, Chris Pine <nemo / hellotree.com> wrote: >----- Original Message ----- >From: "Chris Pine" <nemo / hellotree.com> > >Maybe I'm not understanding, but can't you just call `new' on the class you >want to instantiate? >---------------------------- > >Sorry if that was too short as to be unhelpful. What I meant was that, if >you have the class object on the C side, you can just call `new' on it with >one of these: > > rb_funcall > rb_funcall2 > rb_funcall3 > rb_apply > >You will need to get the id for `new' first, with this: > > new_id = rb_intern ("new"); > >Most of this is on page 193 of the pickaxe. > > >Or, you could just do this (which is slower): > > rb_eval_string ("YourRubyClass.new"); > Hmmmm.... but how does the C side 'know' where my Ruby class is defined? There doesn't seem to be a 'rb_require'. I guess I should just try it out. I suppose if on the Ruby side I've got: require 'SomeClass' require 'MyCExtention' That perhaps MyCExtention might then have access to SomeClass (?) Phil