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