title: Ruby class types and case statements
body: <p>What is the difference between</p>
  
  <pre><code>case item.class
  when MyClass
    # do something here
  when Array
    # do something different here
  when String
    # do a third thing
  end
  </code></pre>
  
  <p>and </p>
  
  <pre><code>case item.class
  when MyClass.class
    # do something here
  when Array.class
    # do something different here
  when String.class
    # do a third thing
  end
  </code></pre>
  
  <p>For some reason, the first one of these works sometimes and the second doesn't, and other times, the second one works and the first one doesn't.  Why?  Which one is the "proper" way to do it?</p>