Project

General

Profile

Feature #17315

Updated by sawa (Tsuyoshi Sawada) 10 months ago

Add a new methods to `transform` or and `transform!` a hash providing both the keys key and the values of a value and returning hash. 
 #7793  

 ```ruby 
 h = {'name' { 'name' => 'dominic ', 'email' => 'dominic.mail.com '} 
 h.transform!{|k,v| [k.to_sym, v.strip]} 
 h # => {name: ``` 

 `h` is now `{ name: 'dominic', email: 'dominic.mail.com'} 
 ``` 'dominic.mail.com}`.

Back