Ruby C: How to convert any object type into a T_STRING?

Hi, I’m coding a Ruby C extension and I need to convert a VALUE of any
class into a T_STRING.
I don’t find a function for that, could somebody indicate it please?

Thanks a lot.

Hi,

You can try

VALUE anyVal;

VALUE strVal = rb_funcall(anyVal, rb_intern(“to_s”), 0);

Regards,

Bill

2011/10/27 Admin T. [email protected]:

You can try

VALUE anyVal;

VALUE strVal = rb_funcall(anyVal, rb_intern(“to_s”), 0);

Thanks :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs