E
Elias Athanasopoulos
Hello!
I want to get the class of an object through the Ruby C API.
Actually, I want what foo.class does.
I tried:
foo = STR2CSTR(rb_iv_get(self, "@class"));
but it doesn't work.
I also tried:
foo = rb_obj_as_string(rb_obj_class(self));
which it seems to work, but it produces a strange output:
% ruby gen.rb
gen.rb:11: warning:
Foo
(Notice the '\n's after warning
Is there another better way? (Okay I can replace '\n's but it
seems to me that I'm following the wrong way).
Regards,
I want to get the class of an object through the Ruby C API.
Actually, I want what foo.class does.
I tried:
foo = STR2CSTR(rb_iv_get(self, "@class"));
but it doesn't work.
I also tried:
foo = rb_obj_as_string(rb_obj_class(self));
which it seems to work, but it produces a strange output:
% ruby gen.rb
gen.rb:11: warning:
Foo
(Notice the '\n's after warning
Is there another better way? (Okay I can replace '\n's but it
seems to me that I'm following the wrong way).
Regards,