Document the change to Array.wrap's behaviour that was made in b4d8c7d148
This commit is contained in:
parent
9c9ec2172e
commit
9eabbabe74
|
@ -2249,8 +2249,8 @@ The method +Array.wrap+ wraps its argument in an array unless it is already an a
|
|||
Specifically:
|
||||
|
||||
* 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, returns an array with the argument as its single element.
|
||||
* 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, an array with the argument as its single element is returned.
|
||||
|
||||
<ruby>
|
||||
Array.wrap(nil) # => []
|
||||
|
|
Loading…
Reference in New Issue