[TOP][UP][<-PREV][NEXT->]

class.c

VALUE rb_define_class(const char *name, VALUE super)

クラス super の下位クラス name を作成し返します。

VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)

クラス super の下位クラス outer::name を作成し返します。

VALUE rb_define_module(const char *name)

モジュール name を作成し返します。

VALUE rb_define_module_under(VALUE outer, const char *name)

モジュール outer::name を作成し返します。

void rb_define_method(VALUE klass, const char *name, VALUE(*func)(), int argc)

クラスklassのインスタンスメソッドnameを定義します。

argcはCの関数へ渡される引数の数(と形式)を決めます.

rb_scan_argsも参照

void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(), int argc)

クラス klass にプライベートのインスタンスメソッド name を 定義します。func に関数ポインタで与え、その関数がとる 引数のタイプを argc に渡します。argc のフォーマットに ついては rb_define_method の記述を参照してください。

void rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(), int argc)

obj に特異メソッド name を定義します。 メソッドの実体を func に関数ポインタで与え、その関数がとる 引数のタイプを argc に渡します。argc のフォーマットに ついては rb_define_method の記述を参照してください。

void rb_define_module_function(VALUE module, const char *name, VALUE (*func)(), int argc)

モジュール module にモジュール関数 name を定義します。 funcargcrb_define_method と同じです。

void rb_define_global_function(const char *name, VALUE (*func)(), int argc)

関数 name を定義します。 funcargcrb_define_method と同じです。

void rb_define_alias(VALUE klass, const char *new, const char *old)

クラス klass のインスタンスメソッド old の 別名 new を定義します。

void rb_undef_method(VALUE klass, const char *name)

クラス klass のインスタンスメソッド name を undef します。


[TOP][UP][<-PREV][NEXT->]