Method: Immutable::Set#select
- Defined in:
- lib/immutable/set.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.
195 196 197 198 199 |
# File 'lib/immutable/set.rb', line 195 def select return enum_for(:select) unless block_given? trie = @trie.select { |key, _| yield(key) } new_trie(trie) end |