[前][次][番号順一覧][スレッド一覧]

ruby-changes:31991

From: ktsj <ko1@a...>
Date: Sun, 8 Dec 2013 17:54:29 +0900 (JST)
Subject: [ruby-changes:31991] ktsj:r44070 (trunk): * object.c: [DOC] document Module#singleton_class?.

ktsj	2013-12-08 17:54:23 +0900 (Sun, 08 Dec 2013)

  New Revision: 44070

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44070

  Log:
    * object.c: [DOC] document Module#singleton_class?.

  Modified files:
    trunk/ChangeLog
    trunk/object.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44069)
+++ ChangeLog	(revision 44070)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Dec  8 17:52:24 2013  Kazuki Tsujimoto  <kazuki@c...>
+
+	* object.c: [DOC] document Module#singleton_class?.
+
 Sun Dec  8 16:19:28 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* class.c (rb_get_kwargs): if optional is negative, unknown
Index: object.c
===================================================================
--- object.c	(revision 44069)
+++ object.c	(revision 44070)
@@ -2459,6 +2459,19 @@ rb_mod_cvar_defined(VALUE obj, VALUE iv) https://github.com/ruby/ruby/blob/trunk/object.c#L2459
     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)
 {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]