diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 00:43:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-25 00:43:13 +0000 |
commit | bdf32ff14f062b1813ccbf71f47fb301a0f47513 (patch) | |
tree | 91fc8fea6be4f0076b8e09f29be52e38a2652fa3 /array.c | |
parent | d866a4202518df17b0acd02a601a56a4b44e252e (diff) | |
download | ruby-bdf32ff14f062b1813ccbf71f47fb301a0f47513.tar.gz |
* 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
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -249,11 +249,20 @@ rb_check_array_type(VALUE ary) * * 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 - * 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") # => 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 rb_ary_s_try_convert(VALUE dummy, VALUE ary) { |