title: Instance variable inside singleton class
body: <p>I have the following piece of code:</p>
  
  <pre><code>class Fish
  # @message = "I can swim"
  
   class &lt;&lt; self
    @message = "I can jump!"
    define_method(:action) { @message }
   end
  end
  
  
  Fish.action  =&gt; nil
  </code></pre>
  
  <p>As soon as I uncomment the above <code>@message</code> variable, <code>Fish.action</code> returns <code>I can swim</code>. Why in both cases it is ignoring the <code>I can jump</code> message. Why is that? Why is Fish class being binded to the <code>@message</code> defined at the start but not inside the <code>singleton</code> class?    </p>