I searched around, but cannot find any built-in way to convert an object (my own creation) into a hash of values, so I need to look elsewhere.
My thought was to use .instance_variables, separate @from the front of each variable, and then use attr_accessorfor each to create a hash.
What do you guys think? Is this the "Ruby Way", or is there a better way to do this?
source
share