Hi there. I have a rather unusual use case whereby I need to be able to obtain the number of parameters a given block has been defined to take. For example...
foobar(1,2,3) { |a, b, c|
}
def foobar(x, y, z, &block)
# need to obtain number of arguments in block
# which would be 3 in this example
end
From what I understand, this is possible in the 1.9 trunk, but not in any official release. I was hoping if there's any way to do this without having to download a separate gem/extension module. Thank you.