On Mar 20, 2010, at 05:25 , David Vlad wrote:

> Ryan Davis wrote:
>> ---------------------------------------------------------- Array#collect
>>     array.collect {|item| block }  -> an_array
>>     array.map     {|item| block }  -> an_array
>> ------------------------------------------------------------------------
>>     Invokes _block_ once for each element of _self_. Creates a new
>>     array containing the values returned by the block. See also
>>     +Enumerable#collect+.
>> 
>>        a = [ "a", "b", "c", "d" ]
>>        a.collect {|x| x + "!" }   #=> ["a!", "b!", "c!", "d!"]
>>        a                          #=> ["a", "b", "c", "d"]
> 
> I know what it does, but still it dosnt work.

You seem to be missing the big clue: "CREATES A NEW ARRAY"

P.S. "it doesn't work" is NOT descriptive.