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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>