title: Convert a hash into a struct
body: <p>How can I convert a hash into a struct in ruby?</p>
  
  <p>Given this:</p>
  
  <pre><code>h = { :a =&gt; 1, :b =&gt; 2 }
  </code></pre>
  
  <p>I want a struct such that:</p>
  
  <pre><code>s.a == 1
  s.b == 2
  </code></pre>