Is there a way in Ruby to get the current method's list of arguments and their current value (during method run)? As in:
def foo(a, b, c)
arg_vals = __method__params__
return arg_vals
end
x = foo(10,20,30) #returns {a:10, b:20, c:30}
(Background: I want this for my logging library, so that from any point I could call: )
my_logger(__method__, __method__params__)