method

select

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

Invokes the block passing in successive elements from array, returning an array containing those elements for which the block returns a true value (equivalent to Enumerable#select).

   a = %w{ a b c d e f }
   a.select {|v| v =~ /[aeiou]/}   #=> ["a", "e"]