summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-27 13:55:21 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-27 13:55:21 +0000
commitffd86054f511f167bc268b8f1d4df1d63caf34e2 (patch)
tree32c75615d531d590af4b0f1843c7b8e0344c49d9
parentc5719d9a756391ff365d92d62523222a7066d819 (diff)
* object.c (rb_mod_attr_accessor, rb_mod_const_set): made rdoc
more precise by specifying Object can searched for Modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--object.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/object.c b/object.c
index 861f17c20e8..850e800fee1 100644
--- a/object.c
+++ b/object.c
@@ -1701,12 +1701,14 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
* call-seq:
* mod.const_get(sym, inherit=true) -> obj
*
- * Returns the value of the named constant in <i>mod</i>.
+ * Checks for a constant with the given name in <i>mod</i>
+ * If +inherit+ is set, the lookup will also search
+ * the ancestors (and +Object+ if <i>mod</i> is a +Module+.)
*
- * Math.const_get(:PI) #=> 3.14159265358979
+ * The value of the constant is returned if a definition is found,
+ * otherwise a +NameError+ is raised.
*
- * If the constant is not defined or is defined by the ancestors and
- * +inherit+ is false, +NameError+ will be raised.
+ * Math.const_get(:PI) #=> 3.14159265358979
*/
static VALUE
@@ -1757,12 +1759,15 @@ rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
* call-seq:
* mod.const_defined?(sym, inherit=true) -> true or false
*
- * Returns <code>true</code> if a constant with the given name is
- * defined by <i>mod</i>, or its ancestors if +inherit+ is not false.
+ * Checks for a constant with the given name in <i>mod</i>
+ * If +inherit+ is set, the lookup will also search
+ * the ancestors (and +Object+ if <i>mod</i> is a +Module+.)
+ *
+ * Returns whether or not a definition is found:
*
* Math.const_defined? "PI" #=> true
- * IO.const_defined? "SYNC" #=> true
- * IO.const_defined? "SYNC", false #=> false
+ * IO.const_defined? :SYNC #=> true
+ * IO.const_defined? :SYNC, false #=> false
*/
static VALUE