On Tue, May 07, 2002 at 12:06:37AM +0900, Radu M. Obad? wrote:
> Hi,
> I'm new to Ruby, and I must say I really like it, quite much that is. I 
> have a question... I know this has been posted before, I've searched the 
> mailing list but I found no satisfying answers. Here it is: I'm working 
> on a "pure" C++ applicationa, and I want to embedd Ruby so that my app 
> gets extensible by Ruby scripts.
> I also want to expose some C++ objects to Ruby, so that the scripts can 
> access those objects. I've looked over the Ruby interface for 
> extending/embedding, and IMHO it seems pretty akwards.. it's plain old 
> C. If anyone could help me with some specific, extensive examples I 
> would really appreciate it. I can give more details, if that would 
> help.
> Regards,
> Radu
> 

I advise you to use SWIG. You'll have to check out the CVS version, but
it's quite stable and everything. it will take care of the details. be
warned though, it doesn't do very complex features of C++ well.

swig.org

If you don't use swig, you'll end up basically doing what it does:
encapsulating your class in C, then wrapping Ruby around that

-- 

Doubt is a pain too lonely to know that faith is his twin brother.
- Gibran Khalil Gibran