title: Does Ruby have a method_missing equivalent for undefined instance variables?
body: <p>When I invoke a method that doesn't exist, <code>method_missing</code> will tell me the name of the method. When I attempt to access a variable that hasn't been set, the value is simply <code>nil</code>.</p>
  
  <p>I'm attempting to dynamically intercept access to nil instance variables and return a value based on the name of the variable being accessed. The closest equivalent would be PHP's <a href="http://www.php.net/manual/en/language.oop5.overloading.php" rel="noreferrer"><code>__get</code></a>. Is there any equivalent functionality in Ruby?</p>