Ruby 1.9.3p327(2012-11-10revision37606)
|
00001 #include "ruby.h" 00002 00003 VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*); 00004 00005 static VALUE 00006 with_funcall2(int argc, VALUE *argv, VALUE self) 00007 { 00008 return rb_funcall2(self, rb_intern("target"), argc, argv); 00009 } 00010 00011 static VALUE 00012 with_funcall_passing_block(int argc, VALUE *argv, VALUE self) 00013 { 00014 return rb_funcall_passing_block(self, rb_intern("target"), argc, argv); 00015 } 00016 00017 void 00018 Init_funcall(void) 00019 { 00020 VALUE cRelay = rb_path2class("TestFuncall::Relay"); 00021 00022 rb_define_singleton_method(cRelay, 00023 "with_funcall2", 00024 with_funcall2, 00025 -1); 00026 rb_define_singleton_method(cRelay, 00027 "with_funcall_passing_block", 00028 with_funcall_passing_block, 00029 -1); 00030 } 00031