From: ts Date: 2004-04-29T01:13:43+09:00 Subject: Re: Learning extending ruby >>>>> "D" == Dominik Werder writes: D> class Test D> attr_reader :myvar D> end When you write this, you call the class Method ::attr_reader. This mean that in your case, you must call rb_define_attr() with cRubyTest D> void Init_cRubyTest() { D> cRubyTest = rb_define_class("Test", rb_cObject); rb_define_attr(cRubyTest, "myvar", Qtrue, Qfalse); D> rb_define_method(cRubyTest, "initialize", t_init, 0); D> rb_define_method(cRubyTest, "add", t_add, 1); D> rb_define_method(cRubyTest, "change", t_change, 0); D> } Guy Decoux