I am curious if as to whether or not it would be possible to loop through the instance variables of an object and dump out some basic debug information.
I know you can get a list of instance variables by doing object.instance_variables which returns an array of symbolized variables like [:@var1, :@var2, :@etc] My first guess at how to do this was:
obj.instance_variables.each do
obj.instance_variable_get(var).to_yaml
end
but i am getting the following error: "can't dump anonymous class Class". What might a better approach be?