Project

General

Profile

Actions

Feature #17315

open

Hash #transform

Added by dsisnero (Dominic Sisneros) 10 months ago. Updated 10 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:100765]

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

Also available in: Atom PDF