Method: Immutable::Hash#select
- Defined in:
- lib/immutable/hash.rb
#select {|key, value| ... } ⇒ Hash Also known as: find_all, keep_if
Return a new Hash with all the key/value pairs for which the block returns true.
438 439 440 441 |
# File 'lib/immutable/hash.rb', line 438 def select(&block) return enum_for(:select) unless block_given? derive_new_hash(@trie.select(&block)) end |