From: dwerder@... (Dominik Werder) Date: 2004-04-28T16:04:02+09:00 Subject: Learning extending ruby Hello! Could somebody help me with this small piece of code? I'm learning how to extend ruby with C code. What I want to do here is creating a class in C and use it in ruby. The class should have a instance variable named myvar. This works so far. But now how do I create the accessor methods for this variable? Thank you! Dominik Here is the init method in C: static VALUE t_init(VALUE self) { VALUE str = rb_str_new2("default string"); rb_iv_set(self, "@myvar", str); rb_define_attr(str, "myvar", 1, 1); return self; } BTW: Is there any good doc beside the prag. prog. guide about extending ruby?