From: Shugo Maeda Date: 2012-01-13T11:07:31+09:00 Subject: [ruby-core:42105] Re: [ruby-trunk - Bug #5887] The documentation of Module.constants is incorrect Hi, 2012/1/13 Marc-Andre Lafortune : >> OT: I think Module.constants should be renamed in the future, because Module.constants is confusing with Module#constants. �Why the hell do I have to write the following tricky code to invoke Module#constants on Module itself? >> >> � p Module.instance_method(:constants).bind(Module).call > > Actually, you can simply pass a parameter to `Module.constants` and the singleton method will call the instance method. The documentation should definitely reflect this too... Oh, I didn't know that. However, I doubt that Matz has accepted the feature. The optional arguments of Module.constants were introduced by nobu in r11338, but the change of Module.constants was not described in the commit log. * intern.h, object.c, variable.c (rb_mod_constants): added an optional flag to search ancestors, which is defaulted to true, as well as const_defined? and const_get. [ruby-dev:29989] It was not discussed in the thread starting from [ruby-dev:29989] either. Is it an official feature? -- Shugo Maeda