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

ruby-changes:22232

From: marcandre <ko1@a...>
Date: Fri, 13 Jan 2012 01:37:28 +0900 (JST)
Subject: [ruby-changes:22232] marcandRe: r34280 (trunk): * eval.c: Improve rdoc for Module.constants [issue #5887]

marcandre	2012-01-13 01:37:03 +0900 (Fri, 13 Jan 2012)

  New Revision: 34280

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

  Log:
    * eval.c: Improve rdoc for Module.constants [issue #5887]

  Modified files:
    trunk/eval.c

Index: eval.c
===================================================================
--- eval.c	(revision 34279)
+++ eval.c	(revision 34280)
@@ -286,15 +286,23 @@
 /*
  *  call-seq:
  *     Module.constants   -> array
+ *     Module.constants(inherited)   -> array
  *
- *  Returns an array of the names of all constants defined in the
- *  system. This list includes the names of all modules and classes.
+ *  In the first form, returns an array of the names of all
+ *  constants accessible from the point of call.
+ *  This list includes the names of all modules and classes
+ *  defined in the global scope.
  *
- *     p Module.constants.sort[1..5]
+ *     Module.constants.first(4)
+ *        # => [:ARGF, :ARGV, :ArgumentError, :Array]
  *
- *  <em>produces:</em>
+ *     Module.constants.include?(:SEEK_SET)   # => false
  *
- *     ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
+ *     class IO
+ *       Module.constants.include?(:SEEK_SET) # => true
+ *     end
+ *
+ *  The second form calls the instance method +constants+.
  */
 
 static VALUE

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

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