From 491691b9c31e9c17207add785cb650e21e1feb14 Mon Sep 17 00:00:00 2001
From: Anuj Dutta <anuj@andhapp.com>
Date: Sat, 28 May 2011 09:32:12 +0100
Subject: [PATCH] Improved documentation for const_missing

---
 variable.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/variable.c b/variable.c
index 426d58f..51da22a 100644
--- a/variable.c
+++ b/variable.c
@@ -1373,12 +1373,18 @@ const_missing(VALUE klass, ID id)
  *  Invoked when a reference is made to an undefined constant in
  *  <i>mod</i>. It is passed a symbol for the undefined constant, and
  *  returns a value to be used for that constant. The
- *  following code is a (very bad) example: if reference is made to
- *  an undefined constant, it attempts to load a file whose name is
- *  the lowercase version of the constant (thus class <code>Fred</code> is
- *  assumed to be in file <code>fred.rb</code>). If found, it returns the
- *  value of the loaded class. It therefore implements a perverse
- *  kind of autoload facility.
+ *  following code is an example of the same: 
+ *
+ *    def Foo.const_missing (name)
+ *      name  # return the constant name as Symbol
+ *    end
+ *    Foo::UNDEFINED_CONST    #=> :UNDEFINED_CONST: symbol returned
+ *
+ *  In the next example when a reference is made to an undefined constant,
+ *  it attempts to load a file whose name is the lowercase version of the
+ *  constant (thus class <code>Fred</code> is assumed to be in file
+ *  <code>fred.rb</code>). If found, it returns the value of the loaded
+ *  class. It therefore implements a perverse kind of autoload facility.
  *
  *    def Object.const_missing(name)
  *      @looked_for ||= {}
-- 
1.6.3.2

