Afficher un message
Vieux 12/03/2008, 03h29   #8
Nikhil Warade
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: shortcut for x = unless x.is_a?(Array)

Paul Mckibbin wrote:
>
>> => some warning about default to_a being deprecated
>>
>> Todd

>
> which is why x=Array(x) would be better.
>
> Mac


(1..3).to_a will not give any warning and will convert it to [1,2,3]
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
 
Page generated in 0,05064 seconds with 9 queries