Method: Immutable::Set#select
- Defined in:
- lib/immutable/_core.rb
#select {|item| ... } ⇒ Set Also known as: find_all, keep_if
Return a new Set with all the items for which the block returns true.
2679 2680 2681 2682 2683 |
# File 'lib/immutable/_core.rb', line 2679 def select return enum_for(:select) unless block_given? trie = @trie.select { |key, _| yield(key) } new_trie(trie) end |