title: Convert array of hashes to array of structs?
body: <p>Let's say I have two objects: User and Race.  </p>
  
  <pre><code>class User
    attr_accessor :first_name
    attr_accessor :last_name
  end
  
  class Race
    attr_accessor :course
    attr_accessor :start_time
    attr_accessor :end_time
  end
  </code></pre>
  
  <p>Now let's say I create an array of hashes like this:</p>
  
  <pre><code>user_races = races.map{ |race| {:user =&gt; race.user, :race =&gt; race} }
  </code></pre>
  
  <p>How do I then convert user_races into an array of structs, keeping in mind that I want to be able to access the attributes of both user and race from the struct element? (The key thing is I want to create a new object via Struct so that I can access the combined attributes of User and Race. For example, UserRace.name, UserRace.start_time.)</p>