1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_s_try_convert): more document description.

* re.c (rb_reg_s_try_convert): typo fixed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-08-25 00:43:13 +00:00
parent d866a42025
commit bdf32ff14f
3 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Sat Aug 25 09:39:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_s_try_convert): more document description.
* re.c (rb_reg_s_try_convert): typo fixed.
Sat Aug 25 08:54:12 2007 Koichi Sasada <ko1@atdot.net> Sat Aug 25 08:54:12 2007 Koichi Sasada <ko1@atdot.net>
* id.h, id.c: remove idFuncall. * id.h, id.c: remove idFuncall.

11
array.c
View file

@ -249,11 +249,20 @@ rb_check_array_type(VALUE ary)
* *
* Try to convert <i>obj</i> into an array, using to_ary method. * Try to convert <i>obj</i> into an array, using to_ary method.
* Returns converted array or nil if <i>obj</i> cannot be converted * Returns converted array or nil if <i>obj</i> cannot be converted
* for any reason. * for any reason. This method is to check if an argument is an
* array.
* *
* Array.try_convert([1]) # => [1] * Array.try_convert([1]) # => [1]
* Array.try_convert("1") # => nil * Array.try_convert("1") # => nil
*
* if tmp = Array.try_convert(arg)
* # the argument is an array
* elsif tmp = String.try_convert(arg)
* # the argument is a string
* end
*
*/ */
static VALUE static VALUE
rb_ary_s_try_convert(VALUE dummy, VALUE ary) rb_ary_s_try_convert(VALUE dummy, VALUE ary)
{ {

4
re.c
View file

@ -2042,8 +2042,8 @@ rb_check_regexp_type(VALUE re)
* Returns converted regexp or nil if <i>obj</i> cannot be converted * Returns converted regexp or nil if <i>obj</i> cannot be converted
* for any reason. * for any reason.
* *
* IO.try_convert(/re/) # => /re/ * Regexp.try_convert(/re/) # => /re/
* IO.try_convert("re") # => nil * Regexp.try_convert("re") # => nil
*/ */
static VALUE static VALUE
rb_reg_s_try_convert(VALUE dummy, VALUE re) rb_reg_s_try_convert(VALUE dummy, VALUE re)