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

ruby-changes:15925

From: marcandre <ko1@a...>
Date: Tue, 18 May 2010 06:07:56 +0900 (JST)
Subject: [ruby-changes:15925] Ruby:r27867 (trunk): * proc.c (proc_lambda, unnamed_parameters): Small documentation fixes.

marcandre	2010-05-18 06:07:46 +0900 (Tue, 18 May 2010)

  New Revision: 27867

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

  Log:
    * proc.c (proc_lambda, unnamed_parameters): Small documentation fixes.
    
    * re.c: ditto
    
    * string.c: ditto
    
    * time.c: ditto

  Modified files:
    trunk/proc.c
    trunk/re.c
    trunk/string.c
    trunk/time.c

Index: time.c
===================================================================
--- time.c	(revision 27866)
+++ time.c	(revision 27867)
@@ -2117,13 +2117,7 @@
 /*
  *  call-seq:
  *     Time.new -> time
- *     Time.new(year) -> time
- *     Time.new(year, month) -> time
- *     Time.new(year, month, day) -> time
- *     Time.new(year, month, day, hour) -> time
- *     Time.new(year, month, day, hour, min) -> time
- *     Time.new(year, month, day, hour, min, sec) -> time
- *     Time.new(year, month, day, hour, min, sec, utc_offset) -> time
+ *     Time.new(year, month=nil, day=nil, hour=nil, min=nil, sec=nil, utc_offset=nil) -> time
  *
  *  Returns a <code>Time</code> object.
  *
@@ -3089,7 +3083,7 @@
 
 /*
  *  call-seq:
- *     time.to_r -> Rational
+ *     time.to_r -> a_rational
  *
  *  Returns the value of <i>time</i> as a rational number of seconds
  *  since the Epoch.
Index: re.c
===================================================================
--- re.c	(revision 27866)
+++ re.c	(revision 27867)
@@ -2836,9 +2836,9 @@
 
 /*
  *  call-seq:
- *     Regexp.new(string [, options] [, lang])       -> regexp
+ *     Regexp.new(string, [options [, lang]])        -> regexp
  *     Regexp.new(regexp)                            -> regexp
- *     Regexp.compile(string [, options] [, lang])   -> regexp
+ *     Regexp.compile(string, [options [, lang]])    -> regexp
  *     Regexp.compile(regexp)                        -> regexp
  *
  *  Constructs a new regular expression from <i>pattern</i>, which can be either
Index: string.c
===================================================================
--- string.c	(revision 27866)
+++ string.c	(revision 27867)
@@ -1399,7 +1399,7 @@
  *  Returns converted string or nil if <i>obj</i> cannot be converted
  *  for any reason.
  *
- *     String.try_convert("str")     #=> str
+ *     String.try_convert("str")     #=> "str"
  *     String.try_convert(/re/)      #=> nil
  */
 static VALUE
Index: proc.c
===================================================================
--- proc.c	(revision 27866)
+++ proc.c	(revision 27867)
@@ -528,10 +528,10 @@
 
 /*
  *  call-seq:
- *     prc === obj   -> obj
+ *     prc === obj   -> result_of_proc
  *
  *  Invokes the block, with <i>obj</i> as the block's parameter.  It is
- *  to allow a proc object to be a target of when clause in the case statement.
+ *  to allow a proc object to be a target of +when+ clause in the case statement.
  */
 
 static VALUE
@@ -728,7 +728,10 @@
  * call-seq:
  *    proc.parameters  -> array
  *
- * returns the parameter information of this proc
+ * returns the parameter information of this proc.
+ *
+ *    prc = lambda{|x, y=42, *rest|}
+ *    prc.parameters  #=> [[:req, :x], [:opt, :y], [:rest, :rest]]
  */
 
 static VALUE

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

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