1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/-test-/array/resize/resize.c
Nobuyoshi Nakada 590dc06e38 Get rid of defining methods for tests in core classes
Not to interfere in other tests.
2021-01-09 22:38:06 +09:00

16 lines
348 B
C

#include "ruby/ruby.h"
static VALUE
ary_resize(VALUE klass, VALUE ary, VALUE len)
{
rb_ary_resize(ary, NUM2LONG(len));
return ary;
}
void
Init_resize(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "Array", rb_cObject);
rb_define_singleton_method(klass, "__resize__", ary_resize, 2);
}