data = [1, 17, 3.0, 4] ints = data.grep(Integer) # => [1, 17, 4]: only integers small = ints.grep(0..9) # [1,4]: only in range