summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-12 16:46:15 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-12 16:46:15 +0000
commit160f31e50ed0d447a378025a9b3a7435eb143d57 (patch)
treed82691cc35e585134ae75323f65d39bc37bf7ec1 /eval.c
parentf22910b68ab3bb9bcf7a0795501238045204f3ee (diff)
merge revision(s) 34280:
* eval.c: Improve rdoc for Module.constants [issue #5887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 5b5b4662c0..9ceb833d37 100644
--- a/eval.c
+++ b/eval.c
@@ -286,15 +286,23 @@ rb_mod_nesting(void)
/*
* 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
+ *
+ * class IO
+ * Module.constants.include?(:SEEK_SET) # => true
+ * end
*
- * ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
+ * The second form calls the instance method +constants+.
*/
static VALUE