When developing & debugging, I sometimes wish I could write a 1-liner that dumped the names, types & values of a bunch of variables. The problem is I don\'t know ho
foo = 1 bar = "42" baz = Hash.new %w(foo bar baz).each do |vn| v = eval(vn) puts "#{vn} = (#{v.class}) #{v}" end
But this, of course, doesn't help you if you want a method with 1 argument.