Is it possible to create a Proc from C?

Hi, I would like to implement the following Ruby code in C code (it’s
a simplification):


def self.method1
method2 { method3 }
end

or:


def self.method1
method2(my_proc)
end

where my_proc is a Proc with value:

{ method3 }