ext/-test-/proc/receiver.c
raw| 1 | #include "ruby.h" |
| 2 | |
| 3 | VALUE rb_current_receiver(void); |
| 4 | |
| 5 | static VALUE |
| 6 | bug_proc_call_receiver(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg)) |
| 7 | { |
| 8 | return rb_current_receiver(); |
| 9 | } |
| 10 | |
| 11 | static VALUE |
| 12 | bug_proc_make_call_receiver(VALUE self, VALUE procarg) |
| 13 | { |
| 14 | return rb_proc_new(bug_proc_call_receiver, procarg); |
| 15 | } |
| 16 | |
| 17 | void |
| 18 | Init_receiver(VALUE klass) |
| 19 | { |
| 20 | rb_define_singleton_method(klass, "make_call_receiver", bug_proc_make_call_receiver, 1); |
| 21 | } |