This is part of a script I was working on which definitely returns and array, but I would like the result to be in [[:a, :c].to_set,[:b,:c].to_set].to_set and not [[:c, :b], [:c, :a]].
@potentially_alive = Array.new
if (self_defended?(s))
@potentially_alive.delete_if { |pa| pa.subset?(s.to_set)}
@potentially_alive.push(s.to_set)
end
If your currently result is
[[:a, :c], [:b, :c]]and you would like to to change it to
[[:a, :c].to_set, [:b, :c].to_set]You can to the following (if
@potentially_alive = [[:a, :c], [:b, :c]]):@potentially_alive.map! { |a| a.to_set }or
@potentially_alive = @potentially_alive.map { |a| a.to_set }