Project

General

Profile

Feature #17315

Updated by sawa (Tsuyoshi Sawada) 10 months ago

Add a new methods to `transform` 'transform' and `transform!` 'transform!' a hash providing both key and value and returning hash. 
 #7793  

 ```ruby 
  


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

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

Back