diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-27 13:55:21 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-27 13:55:21 +0000 |
commit | ffd86054f511f167bc268b8f1d4df1d63caf34e2 (patch) | |
tree | 32c75615d531d590af4b0f1843c7b8e0344c49d9 /object.c | |
parent | c5719d9a756391ff365d92d62523222a7066d819 (diff) | |
download | ruby-ffd86054f511f167bc268b8f1d4df1d63caf34e2.tar.gz |
* 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
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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 |