Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/core_extensions.rb
Overview
in lib/core_extensions.rb
Instance Method Summary collapse
-
#remove(*keys) ⇒ Object
non-destructive version.
-
#remove!(*keys) ⇒ Object
pass single or array of keys, which will be removed, returning the remaining hash.
Instance Method Details
#remove(*keys) ⇒ Object
non-destructive version
17 18 19 |
# File 'lib/core_extensions.rb', line 17 def remove(*keys) self.dup.remove!(*keys) end |
#remove!(*keys) ⇒ Object
pass single or array of keys, which will be removed, returning the remaining hash
11 12 13 14 |
# File 'lib/core_extensions.rb', line 11 def remove!(*keys) keys.each{|key| self.delete(key) } self end |