From: "Iñaki Baz Castillo" Date: 2012-04-19T01:34:12+09:00 Subject: C extension: How to get a block passed to a method? Hi, let's imagine the following Ruby code: my_method("hello") { puts "bye" } In pure Ruby the method definition would be: def my_method string, &block puts string block.call end Now the question is: how to do the same at Ruby C level? I assume the following will not work: rb_define_module_function(mModule, "my_method", my_method, 2); since: method(:my_method).arity => 1 So how can I get the block given to a method in C code? Thanks a lot. -- Iñaki Baz Castillo