Ruby拡張ライブラリのコード中で`オブジェクトがあるクラスのインスタンスである'ことを確認する方法
こうかな?
VALUE rb_cUserDefined; /* … */ VALUE test(VALUE self, VALUE input) { if (rb_cUserDefined == rb_obj_class(input)) { return Qtrue; } else { return Qfalse; } } /* … */ void Init_your_ext(void) { /* … */ rb_cUserDefined = rb_define_class("YourClass", rb_cObject); /* … */ }