(C ext to Ruby) variable args count class

i have a class “RFile” with varaible aruments number (1 to 3) this
class is defined under a module “ROSXUtils”

from the module i have three singleton :

m_trash(one arg)

m_move(two args)

m_rename(three args)

in such a situation how can i play with :

rb_class_new_instance(n, &arg, rb_path2class(“RFile”)); ???

because if i put n = 2 i can see that from the class initialisation
method

however i can’t pass de 2 args needed here ???

the same with three args

does i have to build something like an array to pass as arg ???

for m_move by example i have :

m_move(VALUE src_path, VALUE dst_dir, self)

and i want to return an RFile class object using :

rFile = rb_class_new_instance(2, <what kind of args here ???>,
rb_path2class(“RFile”));

any light apreciated :wink:

Yvon

On 8/6/07, unbewust [email protected] wrote:

You need an array of type VALUE (either VALUE* or VALUE[2])

VALUE[2] args;

args[0] = your_first_argument;
args[1] = your_second_argument;

rFile = rb_class_new_instance(2, args, rb_path2class(“RFile”));

Blessings,
TwP

On 6 août, 17:27, “Tim P.” [email protected] wrote:

rFile = rb_class_new_instance(2, <what kind of args here ???>,

Blessings,
TwP

Ok thanks very very much !!!

I’m not too far of publishing a first alpha version of RSOXUtils for
Ruby :wink:

best,

Yvon