Last Updated: February 25, 2016
·
269
· dinks

Select certain types from Array

If you have an array of values in Ruby and select items of a certain type it easily possible.

h = [1, 2, 3, {t: 3}]
h.grep(Hash) # [{t: 3}]