From: Lyndon Samson Date: 2005-04-23T20:34:32+09:00 Subject: Re: Suggestion: Hash.remove On 4/23/05, Andrew Walrond wrote: > Something I often find useful is a version of Hash.delete which returns the > hash rather than the deleted item. Useful for terse chained code. > > class Hash > def remove!(*some_keys) > some_keys.each { |key| delete(key) } > return self > end > def remove(*some_keys) > return dup.remove!(*some_keys) > end > end > > Perhaps something like it is already planned for the next version? If not, > perhaps the Hash maintainer might consider something like it. > I think there is a bias against method chaining by the Ruby Powers-that-Be. > Andrew Walrond > > -- Into RFID? www.rfidnewsupdate.com Simple, fast, news.