title: When to use nested classes and classes nested in modules?
body: <p>I'm pretty familiar with when to use subclasses and modules, but more recently I've been seeing nested classes like this:</p>
  
  <pre><code>class Foo
    class Bar
      # do some useful things
    end
  end
  </code></pre>
  
  <p>As well as classes nested in modules like so:</p>
  
  <pre><code>module Baz
    class Quux
      # more code
    end
  end
  </code></pre>
  
  <p>Either documentation and articles are sparse or I'm not educated on the subject enough to grope for the right search terms, but I can't seem to locate much information on the topic.</p>
  
  <p>Could somebody provide examples or links to posts on why/when those techniques would be used?</p>