I have a Ruby class
class MyClass attr_writer :item1, :item2 end my_array = get_array_of_my_class() #my_array is an array of MyClass unique_array_of_item1 = [
I'm not sure if it's perfect solution, but worked for me:
host_group = Array.new if not host_group.kind_of?(Array) host_group.push(host)