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

ruby-changes:19705

From: marcandre <ko1@a...>
Date: Fri, 27 May 2011 22:55:30 +0900 (JST)
Subject: [ruby-changes:19705] marcandRe: r31750 (trunk): * object.c (rb_mod_attr_accessor, rb_mod_const_set): made rdoc

marcandre	2011-05-27 22:55:21 +0900 (Fri, 27 May 2011)

  New Revision: 31750

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

  Log:
    * object.c (rb_mod_attr_accessor, rb_mod_const_set): made rdoc
      more precise by specifying Object can searched for Modules.

  Modified files:
    trunk/object.c

Index: object.c
===================================================================
--- object.c	(revision 31749)
+++ object.c	(revision 31750)
@@ -1701,12 +1701,14 @@
  *  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+.)
  *
+ *  The value of the constant is returned if a definition is found,
+ *  otherwise a +NameError+ is raised.
+ *
  *     Math.const_get(:PI)   #=> 3.14159265358979
- *
- *  If the constant is not defined or is defined by the ancestors and
- *  +inherit+ is false, +NameError+ will be raised.
  */
 
 static VALUE
@@ -1757,12 +1759,15 @@
  *  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

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

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