From: Eric Hodel Date: 2006-08-09T02:23:22+09:00 Subject: Re: Init_xxx(with arg ??) in C for ruby ext ??? On Aug 8, 2006, at 9:45 AM, Une b�vue wrote: > hey all, > > new to C, i'm writing a ruby ext, i wonder if we could pass an arg to > Init_xxx(type * arg) ??? > > this is to have a constructor in ruby like that : > > trick=MyClass.new("my arg") > > and if not does exists a workaround ??? The Init_ method initializes the shared library, it is not the constructor. Write your #initialize to take arguments and MyClass.new "my arg" will work. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com