From ffd86054f511f167bc268b8f1d4df1d63caf34e2 Mon Sep 17 00:00:00 2001 From: marcandre Date: Fri, 27 May 2011 13:55:21 +0000 Subject: * 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 --- object.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/object.c b/object.c index 861f17c20e..850e800fee 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 mod. + * Checks for a constant with the given name in mod + * If +inherit+ is set, the lookup will also search + * the ancestors (and +Object+ if mod 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 true if a constant with the given name is - * defined by mod, or its ancestors if +inherit+ is not false. + * Checks for a constant with the given name in mod + * If +inherit+ is set, the lookup will also search + * the ancestors (and +Object+ if mod 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 -- cgit v1.2.3