1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ktsj 2013-12-08 08:54:23 +00:00
parent dd8710d243
commit 40468b5bf1
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Sun Dec 8 17:52:24 2013 Kazuki Tsujimoto <kazuki@callcc.net>
* object.c: [DOC] document Module#singleton_class?.
Sun Dec 8 16:19:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_get_kwargs): if optional is negative, unknown

View file

@ -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)
{