Class: Hash
- Includes:
- HashBFS, HashSymbolizeKeysRecursive, HashUnion, Tins::Subhash
- Defined in:
- lib/tins/xt/hash_bfs.rb,
lib/tins/xt/hash_symbolize_keys_recursive.rb,
lib/tins/xt/hash_union.rb,
lib/tins/xt/subhash.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#subhash!(*patterns) ⇒ Hash
The subhash! method creates a filtered subset of this hash based on the given patterns and replaces the current hash with the result.
Methods included from Tins::Subhash
Instance Method Details
#subhash!(*patterns) ⇒ Hash
The subhash! method creates a filtered subset of this hash based on the given patterns and replaces the current hash with the result.
This method works by first calling subhash with the provided patterns to create a new hash containing only the matching key-value pairs, then replacing the contents of the current hash with those pairs.
keys filtered subset
18 19 20 |
# File 'lib/tins/xt/subhash.rb', line 18 def subhash!(*patterns) replace subhash(*patterns) end |