提交 9eabbabe 编写于 作者: J Jon Leighton

Document the change to Array.wrap's behaviour that was made in...

Document the change to Array.wrap's behaviour that was made in b4d8c7d1
上级 9c9ec217
...@@ -2249,8 +2249,8 @@ The method +Array.wrap+ wraps its argument in an array unless it is already an a ...@@ -2249,8 +2249,8 @@ The method +Array.wrap+ wraps its argument in an array unless it is already an a
Specifically: Specifically:
* If the argument is +nil+ an empty list is returned. * If the argument is +nil+ an empty list is returned.
* Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned. * Otherwise, if the argument responds to +to_ary+ it is invoked, and if the value of +to_ary+ is not +nil+, it is returned.
* Otherwise, returns an array with the argument as its single element. * Otherwise, an array with the argument as its single element is returned.
<ruby> <ruby>
Array.wrap(nil) # => [] Array.wrap(nil) # => []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册