title: Converting an object to a hash of values in Ruby
body: <p>I have searched around, but can't find any built-in way to do convert an object (of my own creation) to a hash of values, so must needs look elsewhere.</p>
  
  <p>My thought was to use <code>.instance_variables</code>, strip the <code>@</code> from the front of each variable, and then use the <code>attr_accessor</code> for each to create the hash.</p>
  
  <p>What do you guys think? Is that the 'Ruby Way', or is there a better way to do this?</p>