title: How to change the default value of a Struct attribute?
body: <p>According to <a href="http://www.ruby-doc.org/core-1.9.3/Struct.html#method-c-new" rel="noreferrer">the documentation</a> unset attributes of Struct are set to <code>nil</code>:</p>
  
  <blockquote>
    <p>unset parameters default to nil.</p>
  </blockquote>
  
  <p>Is it possible to specify the default value for particular attributes?</p>
  
  <p>For example, for the following Struct</p>
  
  <pre><code>Struct.new("Person", :name, :happy)
  </code></pre>
  
  <p>I would like the attribute <code>happy</code> to default to <code>true</code> rather than <code>nil</code>. How can I do this? If I do as follows</p>
  
  <pre><code>Struct.new("Person", :name, :happy = true)
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>-:1: syntax error, unexpected '=', expecting ')'
  Struct.new("Person", :name, :happy = true)
                                      ^
  -:1: warning: possibly useless use of true in void context
  </code></pre>