require 'set' s = Set[1, 2, 3, 4, 5] # => #<Set: {5, 1, 2, 3, 4}> s.collect! {|x| x/2 } # => #<Set: {0, 12, 2, 8, 4}>