method

index

Importance_1
v1_9_3_392 - Show latest stable - 0 notes - Class: Matrix
index(*args) public

The index method is specialized to return the index as [row, column] It also accepts an optional selector argument, see #each for details.

Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
Show source
Register or log in to add new notes.