Map elements in a set
require 'set' s = Set[1, 2, 3, 4, 5] # => #<Set: {5, 1, 2, 3, 4}> s.map! {|x| x*x } # => #<Set: {16, 1, 25, 9, 4}>