title: Ruby interface classes?
body: <p>I have the following classes:</p>
  
  <pre><code>CachedObject
  CachedObjectSource
  CachedObjectDbSource &lt; CachedObjectSource
  CachedObjectDalliSource &lt; CachedObjectSource
  </code></pre>
  
  <p>CachedObject is a non-database object that is getting pulled from a third-party API and stored locally.  CachedObject will be stored in both the database and Dalli (memcache), the real-time code will ping the Dalli source for a copy of the object, and the Dalli source will search the database source and update its cache if the object does not exist.  So it's a nested call that requires each child class of CachedObjectSource to implement the same set of methods.  IE, an interface.</p>
  
  <p>Is there a way to write the CachedObjectSource class so that its child classes must implement the interface?  Am I going about this the wrong way?</p>