Ruby 2.1.0 リファレンスマニュアル > 関数一覧 > rb_convert_type

function rb_convert_type

VALUE rb_convert_type(VALUE val, int type, const char *tname, const char *method)

オブジェクト val をクラス type のインスタンスに変換します。 変換には、val.method の戻り値が使われます。

val がもともと type クラスのインスタンスなら val を そのまま返します。