]> git.wincent.com - mkdtemp.git/commitdiff
Don't abuse "rb_define_module_function"
authorWincent Colaiuta <win@wincent.com>
Wed, 28 Jul 2010 20:55:48 +0000 (22:55 +0200)
committerWincent Colaiuta <win@wincent.com>
Wed, 28 Jul 2010 20:55:48 +0000 (22:55 +0200)
"rb_define_singleton_method" seems more appropriate here, even though
the actual behavior seems to be basically equivalent.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/mkdtemp.c

index cd6f85640dc7dc8611737c6d3fc8207be108c28e..91ecdc1d69e5223d7e9a1a38b4e3368456361b0c 100644 (file)
@@ -99,5 +99,5 @@ static VALUE dir_mkdtemp_m(int argc, VALUE *argv, VALUE self)
 
 void Init_mkdtemp()
 {
-    rb_define_module_function(rb_cDir, "mkdtemp", dir_mkdtemp_m, -1);
+    rb_define_singleton_method(rb_cDir, "mkdtemp", dir_mkdtemp_m, -1);
 }