From: marcandre-ruby-core@... Date: 2020-11-10T21:26:29+00:00 Subject: [ruby-core:100767] [Ruby master Feature#17315] Hash #transform Issue #17315 has been updated by marcandre (Marc-Andre Lafortune). Status changed from Closed to Open I'll reopen this, as you are asking for a mutating version of `to_h`. ---------------------------------------- Feature #17315: Hash #transform https://bugs.ruby-lang.org/issues/17315#change-88410 * Author: dsisnero (Dominic Sisneros) * Status: Open * Priority: Normal ---------------------------------------- Add a new methods to 'transform' and 'transform!' a hash providing both key and value and returning hash. #7793 h = { 'name' => 'dominic ', 'email' => 'dominic.mail.com '} h.transform!{|k,v| [k.to_sym, v.strip]} h is now { name: 'dominic', email: 'dominic.mail.com} -- https://bugs.ruby-lang.org/ Unsubscribe: