method

map

v1_8_6_287 - Show latest stable - Class: Array
map()
public

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"]