method

collect

v1_8_7_72 - Show latest stable - Class: Matrix
collect(# :yield: e)
public

Returns a matrix that is the result of iteration of the given block over all elements of the matrix.

  Matrix[ [1,2], [3,4] ].collect { |i| i**2 }
    => 1  4
       9 16