From: marcandre-ruby-core@... Date: 2020-11-10T20:53:21+00:00 Subject: [ruby-core:100766] [Ruby master Feature#17315] Hash #transform Issue #17315 has been updated by marcandre (Marc-Andre Lafortune). Status changed from Open to Closed You'll be happy to hear that this is exactly what `to_h` does already. ---------------------------------------- Feature #17315: Hash #transform https://bugs.ruby-lang.org/issues/17315#change-88409 * Author: dsisnero (Dominic Sisneros) * Status: Closed * 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: