index

index(value, selector = :all) â [row, column]
index(selector = :all){ block } â [row, column]
index(selector = :all) â an_enumerator
Instance Public methods

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]

find_index

doc_ruby_on_rails
2015-04-18 08:20:08
Comments
Leave a Comment

Please login to continue.