title: Proper way to use `class_attribute` with `Hash`
body: <p>Rails has a class extension called <a href="http://guides.rubyonrails.org/active_support_core_extensions.html#class-attributes" rel="noreferrer"><code>class_attribute</code></a> which allows the inheritance of class instance variables. This works fine with immutable objects, e.g. <code>String</code>, but not with mutables:</p>
  
  <pre class="lang-ruby prettyprint-override"><code>class Base
    class_attribute :options
    self.options = {}
  end
  
  class SubClass &lt; Base
  end
  
  Base.options                   # {}
  SubClass.options[:foo] = "bar" # { foo: "bar" }
  Base.options                   # { foo: "bar" }
  </code></pre>
  
  <p>The question is how to let subclasses have their own copy of <code>options</code> without explicitly initializing it in their body:</p>
  
  <pre><code>class SubClass &lt; Base
    self.options = {}
  end
  </code></pre>