From: dsisnero@... Date: 2020-11-13T20:38:07+00:00 Subject: [ruby-core:100843] [Ruby master Feature#17315] Hash #transform Issue #17315 has been updated by dsisnero (Dominic Sisneros). to_h works for me even though it is unintuitive a name for monadic mapping a hash. I wish we had a common name function name in Enumerable for monadic mapping that would return the same Class that we map over. ---------------------------------------- Feature #17315: Hash #transform https://bugs.ruby-lang.org/issues/17315#change-88485 * 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: