Method: Hash#delete_at
- Defined in:
- lib/rext/hash/helpers.rb
#delete_at(*keys) ⇒ Object Also known as: extract!
Delete key-value pairs, returning the values found using the keys passed. Aliased as extract!
Examples
= { :width => 25, :height => 100 }
width, height = .delete_at :width, :height
width # => 25
height # => 100
# => {}
88 89 90 |
# File 'lib/rext/hash/helpers.rb', line 88 def delete_at *keys keys.map { |key| delete key } end |