diff --git a/README.EXT b/README.EXT index c8c9342..a660d43 100644 --- a/README.EXT +++ b/README.EXT @@ -311,6 +311,10 @@ To define nested classes or modules, use the functions below: VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super) VALUE rb_define_module_under(VALUE outer, const char *name) +To look up a constant by a C string, use the function below: + + VALUE rb_path2class(const char *path) + 2.1.2 Method/singleton method definition To define methods or singleton methods, use these functions: diff --git a/README.EXT.ja b/README.EXT.ja index ce2b304..92d41da 100644 --- a/README.EXT.ja +++ b/README.EXT.ja @@ -348,6 +348,10 @@ Rubyで提供されている関数を使えばRubyインタプリタに新しい VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super) VALUE rb_define_module_under(VALUE outer, const char *name) +C の文字列で Ruby クラスを見つけたい時に、以下の関数を使って下さい。 + + VALUE rb_path2class(const char *path) + 2.1.2 メソッド/特異メソッド定義 メソッドや特異メソッドを定義するには以下の関数を使います. diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 6756941..9978410 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -862,7 +862,6 @@ VALUE rb_class_path(VALUE); void rb_set_class_path(VALUE, VALUE, const char*); void rb_set_class_path_string(VALUE, VALUE, VALUE); VALUE rb_path_to_class(VALUE); -VALUE rb_path2class(const char*); void rb_name_class(VALUE, ID); VALUE rb_class_name(VALUE); void rb_autoload(VALUE, ID, const char*); diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 7e534eb..c2c2505 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1074,6 +1074,7 @@ VALUE rb_define_class(const char*,VALUE); VALUE rb_define_module(const char*); VALUE rb_define_class_under(VALUE, const char*, VALUE); VALUE rb_define_module_under(VALUE, const char*); +VALUE rb_path2class(const char*); void rb_include_module(VALUE,VALUE); void rb_extend_object(VALUE,VALUE);