Im trying to do some metaprogramming and would like to know the names of the variables passed as block arguments:
z = 1 # this variable is still local to the block
Proc.new { |x, y| local_variables }.call
# => ['_', 'z', x', 'y']
I am not quite sure how to differentiate between the variables defined outside the block and the block arguments in this list. Is there any other way to reflect this?