require 'set'
array = ['foo', :bar, 'foo', :foobar]
# Sets are much faster than arrays
# when it comes to checking for inclusion,
# intersections etc
set = array.to_set #=> #<Set: {"foo", :bar, :foobar}>
array = set.to_a
p array #=> ["foo", :bar, :foobar]