summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--object.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 16aeba6915..d943bb1b54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Dec 8 17:52:24 2013 Kazuki Tsujimoto <[email protected]>
+
+ * object.c: [DOC] document Module#singleton_class?.
+
Sun Dec 8 16:19:28 2013 Nobuyoshi Nakada <[email protected]>
* class.c (rb_get_kwargs): if optional is negative, unknown
diff --git a/object.c b/object.c
index 87e9608e76..3dc99367bb 100644
--- a/object.c
+++ b/object.c
@@ -2459,6 +2459,19 @@ rb_mod_cvar_defined(VALUE obj, VALUE iv)
return rb_cvar_defined(obj, id);
}
+/*
+ * call-seq:
+ * mod.singleton_class? -> true or false
+ *
+ * Returns <code>true</code> if <i>mod</i> is a singleton class or
+ * <code>false</code> if it is an ordinary class or module.
+ *
+ * class C
+ * end
+ * C.singleton_class? #=> false
+ * C.singleton_class.singleton_class? #=> true
+ */
+
static VALUE
rb_mod_singleton_p(VALUE klass)
{