Actions
Feature #17315
openHash #transform
Feature #17315:
Hash #transform
Status:
Open
Assignee:
-
Target version:
-
Description
Add new methods to transform
or transform!
both the keys and the values of a hash.
#7793
h = {'name' => 'dominic ', 'email' => 'dominic.mail.com '}
h.transform!{|k,v| [k.to_sym, v.strip]}
h # => {name: 'dominic', email: 'dominic.mail.com'}
Actions