title: Ruby class variables
body: <p>The ruby class-instance stuff is giving me a headache.  I understand given this...</p>
  
  <pre><code>class Foo
    @var = 'bar'
  end
  </code></pre>
  
  <p>...that <code>@var</code> is a variable on the created class's instance.</p>
  
  <p>But how do I create a sub-class overridable class variable?</p>
  
  <p>Here is an example of what I would do in Python:</p>
  
  <pre><code>class Fish:
  var = 'fish'
  def v(self):
      return self.var
  
  class Trout(Fish):
      var = 'trout'
  
  class Salmon(Fish):
      var = 'salmon'
  
  print Trout().v()
  print Salmon().v()
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>trout
  salmon
  </code></pre>
  
  <p>How do I do the same thing in ruby?</p>