title: How to assign ruby's OpenStruct attribute using a variable
body: <p>How do I assign ruby's OpenStruct attribute using a variable instead of a pre-defined name.  I can do the following, </p>
  
  <pre><code>os = OpenStruct.new
  os.one = 1
  os.two = "Two"
  </code></pre>
  
  <p>But how do I make it so the attribute name is a variable?
  For example:</p>
  
  <pre><code>attr_name = "sand_box"
  os.#{attr_name} = "Play time!"   #### this doesn't work
  </code></pre>