blob: 1c5d677713557b13fdf620a43557ac10f56828cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <ruby.h>
static const rb_data_type_t test_data = {
"typed_data",
};
static VALUE
test_check(VALUE self, VALUE obj)
{
rb_check_typeddata(obj, &test_data);
return obj;
}
void
Init_typeddata(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "TypedData", rb_cData);
rb_define_singleton_method(klass, "check", test_check, 1);
}
|