collect!()
public
Replaces the elements with ones returned by collect(). Returns an
enumerator if no block is given.
Show source
def collect!
block_given? or return enum_for(__method__) { size }
set = self.class.new
each { |o| set << yield(o) }
replace(set)
end