Flowdock
method

keep_if

Importance_1
v1_9_3_125 - Show latest stable - 0 notes - Class: Array
keep_if() public

Deletes every element of self for which block evaluates to false. See also Array#select!

If no block is given, an enumerator is returned instead.

a = %w{ a b c d e f }
a.keep_if {|v| v =~ /[aeiou]/}   #=> ["a", "e"]
Show source
Register or log in to add new notes.