From: marcandre-ruby-core@... Date: 2020-11-11T16:04:31+00:00 Subject: [ruby-core:100790] [Ruby master Feature#17315] Hash #transform Issue #17315 has been updated by marcandre (Marc-Andre Lafortune). I didn't suggest anything, as I don't see a good name, and I don't see the appeal of this method: - it can not be more efficient than `update` + `to_h` - there's not a frequent usecase that I know of - seems like avoidable mutation - `to_h!` would be strange (conversion + mutation...?) ---------------------------------------- Feature #17315: Hash #transform https://bugs.ruby-lang.org/issues/17315#change-88434 * Author: dsisnero (Dominic Sisneros) * Status: Open * Priority: Normal ---------------------------------------- Add new methods to `transform` or `transform!` both the keys and the values of a hash. #7793 ```ruby h = {'name' => 'dominic ', 'email' => 'dominic.mail.com '} h.transform!{|k,v| [k.to_sym, v.strip]} h # => {name: 'dominic', email: 'dominic.mail.com'} ``` -- https://bugs.ruby-lang.org/ Unsubscribe: