Sha256: a047ed09c013ad129b5231e290debe8b2c6ab6df015635d91c7aa50d503cb8b3
Contents?: true
Size: 461 Bytes
Versions: 9
Compression:
Stored size: 461 Bytes
Contents
#-- # Credit goes to Daniel Schierbeck #++ class Hash # Minor modification to Ruby's Hash#delete method # allowing it to take multiple keys. # # This works niely with hahs#[] and Hash#[]= facets. # # hsh[:a, :b, :c] = 1, 2, 3 # # a, b, c = hsh.delete_values_at(:a, :b, :c) # # [a, b, c] #=> [1, 2, 3] # hsh #=> {} # def delete_values_at(*keys, &block) keys.map{|key| delete(key, &block) } end end
Version data entries
9 entries across 9 versions & 1 rubygems