1. How can i make instance method from ? string?

Example:

static VALUE method_factory(VALUE self, VALUE method_name) {
    ....
    buf = ALLOCA_N(char,strlen(method_name)*2 + 20);
    sprintf(buf, "@%s", method_name, method_name);
    make_instance_method_from_string(self, method_name, buf, 0); //
??????????
    sprintf(buf, "raise InvalidType if argv[0].type != String; @%s =
argv[0]", method_name, method_name);
    make_instance_method_from_string(self, method_name, buf, 1); //
??????????
    ....
}

....
rb_define_module_function(klass, "define_attr_ex", method_factory, 1);

2. How can i get ruby method name for ? function?

Example:

static VALUE mymethod(VALUE self) {
    // How can i get "ruby_method" string here?
}

....
rb_define_method(klass, "ruby_method", mymethod, 0);


Anton Kondakov