summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/-test-/array/resize/resize.c
blob: 08bcee3e7a297af3fe72f45de863153d4914ffb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "ruby/ruby.h"

static VALUE
ary_resize(VALUE ary, VALUE len)
{
    rb_ary_resize(ary, NUM2LONG(len));
    return ary;
}

void
Init_resize(void)
{
    rb_define_method(rb_cArray, "__resize__", ary_resize, 1);
}