title: How to create a class instance and store it as class constant
body: <p>Is it possible with Ruby to instantiate a class and store the instance within the same class as constant?</p>
  
  <pre class="lang-rb prettyprint-override"><code>class MyClass
  
     DEFAULT = MyClass.new("haha")
  
     def initialize(arg)
        puts(arg)
     end
  end
  
  # use it
  instance1 = MyClass::DEFAULT
  instance2 = MyClass.new("hohoho")
  </code></pre>
  
  <p>I tried this, but I get some strange results: 'initialize': wrong number of arguments (given 1, expected 0) (ArgumentError) at the line of the DEFAULT declaration.</p>