Method: Immutable::Set#map
- Defined in:
- lib/immutable/_core.rb
#map {|item| ... } ⇒ Set Also known as: collect
Call the block once for each item in this Set. All the values returned from the block will be gathered into a new Set. If no block is given, an Enumerator is returned instead.
2697 2698 2699 2700 2701 |
# File 'lib/immutable/_core.rb', line 2697 def map return enum_for(:map) if not block_given? return self if empty? self.class.new(super) end |