require 'set' s = Set.new(1..3) # Initial set s.replace(3..4) # Replace all elements. Argument is any enumerable